aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-08-16 15:17:23 +0930
committerAlan Modra <amodra@gmail.com>2019-08-16 15:17:23 +0930
commit0b8b76098ff3d3dcd0c621f2e45cc0b4e7211d6a (patch)
treeaa0c4a7a1f9bc16dfe1490c7cf5c79989417cf10
parent7df6aecc97b96843da080d54414052b1c954ddca (diff)
downloadgdb-0b8b76098ff3d3dcd0c621f2e45cc0b4e7211d6a.zip
gdb-0b8b76098ff3d3dcd0c621f2e45cc0b4e7211d6a.tar.gz
gdb-0b8b76098ff3d3dcd0c621f2e45cc0b4e7211d6a.tar.bz2
PR24909, Uninitialized use on stack in readelf
PR 24909 PR 23499 * readelf.c (get_symbol_version_string): Set sym_info earlier.
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/readelf.c9
2 files changed, 9 insertions, 6 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index b7bdfce..cf8eea7 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2019-08-16 Alan Modra <amodra@gmail.com>
+
+ PR 24909
+ PR 23499
+ * readelf.c (get_symbol_version_string): Set sym_info earlier.
+
2019-08-15 Nick Clifton <nickc@redhat.com>
PR 24767
diff --git a/binutils/readelf.c b/binutils/readelf.c
index b90d3bc..cc16816 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -11528,6 +11528,7 @@ get_symbol_version_string (Filedata * filedata,
if ((vers_data & VERSYM_HIDDEN) == 0 && vers_data == 0)
return NULL;
+ *sym_info = (vers_data & VERSYM_HIDDEN) != 0 ? symbol_hidden : symbol_public;
max_vd_ndx = 0;
/* Usually we'd only see verdef for defined symbols, and verneed for
@@ -11593,12 +11594,8 @@ get_symbol_version_string (Filedata * filedata,
ivda.vda_name = BYTE_GET (evda.vda_name);
if (psym->st_name != ivda.vda_name)
- {
- *sym_info = ((vers_data & VERSYM_HIDDEN) != 0
- ? symbol_hidden : symbol_public);
- return (ivda.vda_name < strtab_size
- ? strtab + ivda.vda_name : _("<corrupt>"));
- }
+ return (ivda.vda_name < strtab_size
+ ? strtab + ivda.vda_name : _("<corrupt>"));
}
}
}