From: Andrew Cagney Date: Wed, 10 Dec 1997 06:30:04 +0000 (+0000) Subject: * dwarf2read.c (dwarf2_build_psymtabs_hard): Check cu_header.length is X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=760410e55a930d20c5800b09f5c468a7a8f5279d;p=binutils-gdb.git * dwarf2read.c (dwarf2_build_psymtabs_hard): Check cu_header.length is within dwarf_info_buffer not dwarf_abbrev_buffer. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 066b65195ad..fcc36238b1d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Wed Dec 10 15:54:00 1997 Andrew Cagney + + * dwarf2read.c (dwarf2_build_psymtabs_hard): Check + cu_header.length is within dwarf_info_buffer not + dwarf_abbrev_buffer. + Mon Dec 8 15:51:45 1997 Keith Seitz * gdbtk.c (gdb_get_tracepoint_info): use info in struct diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index e12953d60e6..614ba9234a5 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; }