realloc in get_offsets will return NULL otherwise and dwarf_getpubnames
might think there was no issue and try to use that NULL pointer.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
2014-12-15 Mark Wielaard <mjw@redhat.com>
* dwarf_getpubnames.c (get_offsets): Make sure whole unit fall inside
- section data.
+ section data. Set error to DWARF_E_NO_ENTRY if cnt is zero.
(dwarf_getpubnames): Make sure section data contains string zero
terminator.
readp += len;
}
- if (mem == NULL)
+ if (mem == NULL || cnt == 0)
{
__libdw_seterrno (DWARF_E_NO_ENTRY);
return -1;