Commit 81376e7205

Andrew Kelley <andrew@ziglang.org>
2023-03-01 05:57:59
fix UAF in build runner
1 parent 8acbfaf
Changed files (1)
lib/build_runner.zig
@@ -309,7 +309,7 @@ fn runStepNames(
         }
     }
 
-    const starting_steps = step_stack.items;
+    const starting_steps = try b.allocator.dupe(*Step, step_stack.items);
     for (starting_steps) |s| {
         checkForDependencyLoop(b, s, &step_stack) catch |err| switch (err) {
             error.DependencyLoopDetected => return error.UncleanExit,