Build: fix UAF of step names

This commit is contained in:
Jacob Young committed 2026-09-26 19:08:50 -04:00
1 parent e4c1598ac8
commit 4e4e8902e5
4 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -95,7 +95,7 @@ pub fn init(options: StepOptions) Step {
return .{
.tag = options.tag,
.name = arena.dupe(u8, options.name) catch @panic("OOM"),
.name = options.owner.graph.dupeString(options.name),
.owner = options.owner,
.dependencies = .empty,
.max_rss = options.max_rss,
+1 -1
View File
@@ -41,5 +41,5 @@ pub fn create(owner: *std.Build, file: std.Build.LazyPath, options: Options) *Ch
}
pub fn setName(check_file: *CheckFile, name: []const u8) void {
check_file.step.name = name;
check_file.step.name = check_file.step.owner.graph.dupeString(name);
}
+1 -1
View File
@@ -241,7 +241,7 @@ pub fn create(owner: *std.Build, name: []const u8) *Run {
}
pub fn setName(run: *Run, name: []const u8) void {
run.step.name = name;
run.step.name = run.step.owner.graph.dupeString(name);
run.rename_step_with_output_arg = false;
}
+1 -1
View File
@@ -2502,7 +2502,7 @@ pub fn addStandaloneTests(
.simple_skip_release_small = mem.findScalar(OptimizeMode, optimize_modes, .small) == null,
});
const test_cases_dep_step = test_cases_dep.builder.default_step;
test_cases_dep_step.name = b.graph.dupeString(test_cases_dep_name);
test_cases_dep_step.name = test_cases_dep_name;
step.dependOn(test_cases_dep.builder.default_step);
return step;
}