From 7a28c644aa8eb3d27dee113338af8278f8f6334f Mon Sep 17 00:00:00 2001 From: xackus <14938807+xackus@users.noreply.github.com> Date: Thu, 2 Apr 2020 00:00:42 +0200 Subject: new ArrayList API: fix everything else --- lib/std/debug.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/std/debug.zig') diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 9e14d132a8..ed327fc6de 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -1478,7 +1478,7 @@ pub const ModuleDebugInfo = switch (builtin.os.tag) { var coff_section: *coff.Section = undefined; const mod_index = for (self.sect_contribs) |sect_contrib| { - if (sect_contrib.Section > self.coff.sections.len) continue; + if (sect_contrib.Section > self.coff.sections.items.len) continue; // Remember that SectionContribEntry.Section is 1-based. coff_section = &self.coff.sections.span()[sect_contrib.Section - 1]; -- cgit v1.2.3 From dc54e50db27f76721c33cd437b62ceb598a00447 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Fri, 3 Apr 2020 12:03:36 +0200 Subject: std: Fix one more sentinel buffer overrun --- lib/std/debug.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/std/debug.zig') diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 9e14d132a8..2f5040a926 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -1213,7 +1213,7 @@ pub const DebugInfo = struct { const obj_di = try self.allocator.create(ModuleDebugInfo); errdefer self.allocator.destroy(obj_di); - obj_di.* = openCoffDebugInfo(self.allocator, name_buffer[0..:0]) catch |err| switch (err) { + obj_di.* = openCoffDebugInfo(self.allocator, name_buffer[0 .. len + 4 :0]) catch |err| switch (err) { error.FileNotFound => return error.MissingDebugInfo, else => return err, }; -- cgit v1.2.3