mirror of
https://github.com/openharmony/third_party_elfutils.git
synced 2026-07-19 19:43:34 -04:00
readelf.c (handle_versym): Initialize vername and filename array elements.
We check whether the elements are set before printing their contents, but didn't make sure they were initialized. Reported-by: Hanno Böck <hanno@hboeck.de> Signed-off-by: Mark Wielaard <mjw@redhat.com>
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2014-11-08 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* readelf.c (handle_versym): Initialize vername and filename array
|
||||
elements.
|
||||
|
||||
2014-11-07 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* readelf.c (handle_sysv_hash): Sanity check section contents.
|
||||
|
||||
@@ -2716,7 +2716,9 @@ handle_versym (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
|
||||
|
||||
/* Allocate the array. */
|
||||
vername = (const char **) alloca (nvername * sizeof (const char *));
|
||||
memset(vername, 0, nvername * sizeof (const char *));
|
||||
filename = (const char **) alloca (nvername * sizeof (const char *));
|
||||
memset(filename, 0, nvername * sizeof (const char *));
|
||||
|
||||
/* Run through the data structures again and collect the strings. */
|
||||
if (defscn != NULL)
|
||||
|
||||
Reference in New Issue
Block a user