diff options
author | Andrew Cagney <cagney@redhat.com> | 1997-12-10 06:30:04 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 1997-12-10 06:30:04 +0000 |
commit | 760410e55a930d20c5800b09f5c468a7a8f5279d (patch) | |
tree | 440b25f0297bb543c0290e9dcf4218fc3f61517f /gdb/dwarf2read.c | |
parent | 27be012212cccbdeda56117a31b8cb84c8a42094 (diff) | |
download | gdb-760410e55a930d20c5800b09f5c468a7a8f5279d.zip gdb-760410e55a930d20c5800b09f5c468a7a8f5279d.tar.gz gdb-760410e55a930d20c5800b09f5c468a7a8f5279d.tar.bz2 |
* dwarf2read.c (dwarf2_build_psymtabs_hard): Check cu_header.length is
within dwarf_info_buffer not dwarf_abbrev_buffer.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index e12953d..614ba92 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -937,9 +937,10 @@ dwarf2_build_psymtabs_hard (objfile, section_offsets, mainline) error ("Dwarf Error: bad offset in compilation unit header."); return; } - if (cu_header.length > dwarf_abbrev_size - cu_header.abbrev_offset) + if (beg_of_comp_unit + cu_header.length + 4 + >= dwarf_info_buffer + dwarf_info_size) { - error ("Dwarf Error: bad length in compilation unit header."); + error ("Dwarf Error: bad length in compilation unit header."); return; } |