summaryrefslogtreecommitdiffstats
path: root/libdw/dwarf_getpubnames.c
diff options
context:
space:
mode:
authorUlrich Drepper <[email protected]>2008-01-21 20:38:27 +0000
committerUlrich Drepper <[email protected]>2008-01-21 20:38:27 +0000
commita9f3660eb17167f57ab308ec54a4e8d4c902858a (patch)
tree4b5bcd903d2f7b9c3ba05079572818b9dfda9da0 /libdw/dwarf_getpubnames.c
parentc58110d291bbd39e416d322076dc58bddf56bcf0 (diff)
Update copyright year.
Diffstat (limited to 'libdw/dwarf_getpubnames.c')
-rw-r--r--libdw/dwarf_getpubnames.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libdw/dwarf_getpubnames.c b/libdw/dwarf_getpubnames.c
index 08b96cdc..91dad311 100644
--- a/libdw/dwarf_getpubnames.c
+++ b/libdw/dwarf_getpubnames.c
@@ -129,10 +129,13 @@ get_offsets (Dwarf *dbg)
mem[cnt].cu_offset = read_8ubyte_unaligned (dbg, readp + 2);
/* Determine the size of the CU header. */
- assert (dbg->sectiondata[IDX_debug_info] != NULL);
- assert (dbg->sectiondata[IDX_debug_info]->d_buf != NULL);
- assert (mem[cnt].cu_offset + 3
- < dbg->sectiondata[IDX_debug_info]->d_size);
+ if (dbg->sectiondata[IDX_debug_info] == NULL
+ || dbg->sectiondata[IDX_debug_info]->d_buf == NULL
+ || mem[cnt].cu_offset + 3 >= dbg->sectiondata[IDX_debug_info]->d_size)
+ {
+ __libdw_seterrno (DWARF_E_INVALID_DWARF);
+ goto err_return;
+ }
unsigned char *infop
= ((unsigned char *) dbg->sectiondata[IDX_debug_info]->d_buf
+ mem[cnt].cu_offset);