diff options
author | Mark Wielaard <mjw@redhat.com> | 2014-12-15 16:56:49 +0100 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2014-12-17 16:46:45 +0100 |
commit | 138a9ba2be7e2df2423f86c9ddcca7322648e426 (patch) | |
tree | 79d4974bf212e2a3fd3f7988e7c075dd0c680e06 /libdw/dwarf_getpubnames.c | |
parent | 2323b45d4ee0c4ff6604b60ee3fca5874c149e18 (diff) | |
download | elfutils-138a9ba2be7e2df2423f86c9ddcca7322648e426.tar.gz |
libdw: dwarf_getpubnames set error to DWARF_E_NO_ENTRY for zero entries.
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>
Diffstat (limited to 'libdw/dwarf_getpubnames.c')
-rw-r--r-- | libdw/dwarf_getpubnames.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libdw/dwarf_getpubnames.c b/libdw/dwarf_getpubnames.c index c8b9f9f6..9fbfcbf3 100644 --- a/libdw/dwarf_getpubnames.c +++ b/libdw/dwarf_getpubnames.c @@ -125,7 +125,7 @@ get_offsets (Dwarf *dbg) readp += len; } - if (mem == NULL) + if (mem == NULL || cnt == 0) { __libdw_seterrno (DWARF_E_NO_ENTRY); return -1; |