+2003-09-15 Kevin Buettner <kevinb@redhat.com>
+
+ * dwarf2read.c (dwarf2_get_pc_bounds): Complain if offset
+ associated with DW_AT_ranges attribute is out of bounds.
+
2003-09-15 David Lecomber <dsl@sources.redhat.com>
* f-valprint.c: Apply array element printing limits to multi-dimensional arrays
unsigned int addr_size = cu_header->addr_size;
CORE_ADDR mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1));
/* Value of the DW_AT_ranges attribute is the offset in the
- .debug_renges section. */
+ .debug_ranges section. */
unsigned int offset = DW_UNSND (attr);
/* Base address selection entry. */
CORE_ADDR base;
found_base = cu_header->base_known;
base = cu_header->base_address;
+
+ if (offset >= dwarf_ranges_size)
+ {
+ complaint (&symfile_complaints,
+ "Offset %d out of bounds for DW_AT_ranges attribute",
+ offset);
+ return 0;
+ }
buffer = dwarf_ranges_buffer + offset;
/* Read in the largest possible address. */