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:
Mark Wielaard
2014-11-08 14:04:27 +01:00
parent 6b246e0620
commit d8b9682b1a
2 changed files with 7 additions and 0 deletions
+5
View File
@@ -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.
+2
View File
@@ -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)