aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2014-04-16 14:39:10 -0700
committerKeith Seitz <keiths@redhat.com>2014-04-16 14:39:10 -0700
commit22869d73e127511e177a6bd855f9b5dbe22b9eca (patch)
tree3bc4ba2b15742dd220b1419b33acc9a0e8d00bf6 /gdb/dwarf2read.c
parentc4f87ca6dbe041e2a331e5054a76c9134f29d545 (diff)
downloadgdb-22869d73e127511e177a6bd855f9b5dbe22b9eca.zip
gdb-22869d73e127511e177a6bd855f9b5dbe22b9eca.tar.gz
gdb-22869d73e127511e177a6bd855f9b5dbe22b9eca.tar.bz2
PR gdb/15827
Install some sanity checks that sibling DIE offsets are not beyond the defined limits of the DWARF input buffer in read_partial_die and skip_one_die. 2014-03-20 Keith Seitz <keiths@redhat.com> PR gdb/15827 * dwarf2read.c (skip_one_die): Check that all relative-offset sibling DIEs fall within range of the current reader's buffer. (read_partial_die): Likewise. 2014-03-20 Keith Seitz <keiths@redhat.com> PR gdb/15827 * gdb.dwarf2/corrupt.c: New file. * gdb.dwarf2/corrupt.exp: New file.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 6d1b90c..e72cc4b 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -7104,6 +7104,8 @@ skip_one_die (const struct die_reader_specs *reader, const gdb_byte *info_ptr,
if (sibling_ptr < info_ptr)
complaint (&symfile_complaints,
_("DW_AT_sibling points backwards"));
+ else if (sibling_ptr > reader->buffer_end)
+ dwarf2_section_buffer_overflow_complaint (reader->die_section);
else
return sibling_ptr;
}
@@ -15502,6 +15504,8 @@ read_partial_die (const struct die_reader_specs *reader,
if (sibling_ptr < info_ptr)
complaint (&symfile_complaints,
_("DW_AT_sibling points backwards"));
+ else if (sibling_ptr > reader->buffer_end)
+ dwarf2_section_buffer_overflow_complaint (reader->die_section);
else
part_die->sibling = sibling_ptr;
}