aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug/Dwarf.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2025-05-12 19:03:04 -0400
committerJacob Young <jacobly0@users.noreply.github.com>2025-05-17 02:08:41 -0400
commit4adb7eca6ab2148026a9d2e00379cedfc2038a0d (patch)
treeb5e6bb6bb2b392d152fda3396acd02c1924e68d5 /lib/std/debug/Dwarf.zig
parent025611629f95cda21ff93a517406ea8387ad9cfb (diff)
downloadzig-4adb7eca6ab2148026a9d2e00379cedfc2038a0d.tar.gz
zig-4adb7eca6ab2148026a9d2e00379cedfc2038a0d.zip
debug: correctly detect missing entries in `.eh_frame_hdr`
Diffstat (limited to 'lib/std/debug/Dwarf.zig')
-rw-r--r--lib/std/debug/Dwarf.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/std/debug/Dwarf.zig b/lib/std/debug/Dwarf.zig
index e5d47ba491..06b6c81075 100644
--- a/lib/std/debug/Dwarf.zig
+++ b/lib/std/debug/Dwarf.zig
@@ -402,7 +402,7 @@ pub const ExceptionFrameHeader = struct {
}
}
- if (len == 0) return bad();
+ if (len == 0) return missing();
fbr.pos = left * entry_size;
// Read past the pc_begin field of the entry
@@ -460,6 +460,8 @@ pub const ExceptionFrameHeader = struct {
@sizeOf(usize),
native_endian,
);
+
+ if (pc < fde.pc_begin or pc >= fde.pc_begin + fde.pc_range) return missing();
}
};