diff options
author | Ulrich Drepper <[email protected]> | 2008-01-22 06:08:30 +0000 |
---|---|---|
committer | Ulrich Drepper <[email protected]> | 2008-01-22 06:08:30 +0000 |
commit | 06ec9db81eb938c7ece66f1a8667a1e2b346dae3 (patch) | |
tree | d7b4bcc14292dfd968b16919cdb0c23949dbfa92 /libdw/dwarf_getpubnames.c | |
parent | 4d8bc811506292938ab66120e51c9810e1d21c3d (diff) |
Fix problems in last checkin.
Diffstat (limited to 'libdw/dwarf_getpubnames.c')
-rw-r--r-- | libdw/dwarf_getpubnames.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libdw/dwarf_getpubnames.c b/libdw/dwarf_getpubnames.c index 08b96cdc..fcf6eca4 100644 --- a/libdw/dwarf_getpubnames.c +++ b/libdw/dwarf_getpubnames.c @@ -1,5 +1,5 @@ /* Get public symbol information. - Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2008 Red Hat, Inc. This file is part of Red Hat elfutils. Written by Ulrich Drepper <[email protected]>, 2002. @@ -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); |