diff options
author | Alan Modra <amodra@gmail.com> | 2021-05-13 22:22:45 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-05-13 22:49:17 +0930 |
commit | d21f875d6768aa1e5b8e5442c7e60b03307b1949 (patch) | |
tree | be7f0621c1eb5b5816fd669e03aac29d3abbb9ef /binutils/dwarf.c | |
parent | 0746f49b1dd44ce17b21468b9f8d9715e116a991 (diff) | |
download | gdb-d21f875d6768aa1e5b8e5442c7e60b03307b1949.zip gdb-d21f875d6768aa1e5b8e5442c7e60b03307b1949.tar.gz gdb-d21f875d6768aa1e5b8e5442c7e60b03307b1949.tar.bz2 |
PR27860, Segmentation fault on readelf -w
Well it didn't take long for the SAFE_BYTE_GET assert to trigger.
PR 27860
* dwarf.c (display_debug_frames): Sanity check cie_off before
attempting to read cie.
Diffstat (limited to 'binutils/dwarf.c')
-rw-r--r-- | binutils/dwarf.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 56983e1..20bd926 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -8708,6 +8708,8 @@ display_debug_frames (struct dwarf_section *section, if (cie->chunk_start == look_for) break; } + else if (cie_off >= section->size) + cie = NULL; else { for (cie = forward_refs; cie ; cie = cie->next) |