PR24909, Uninitialized use on stack in readelf

PR 24909
	PR 23499
	* readelf.c (get_symbol_version_string): Set sym_info earlier.
This commit is contained in:
Alan Modra 2019-08-16 15:17:23 +09:30
parent 7df6aecc97
commit 0b8b76098f
2 changed files with 9 additions and 6 deletions

View File

@ -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> 2019-08-15 Nick Clifton <nickc@redhat.com>
PR 24767 PR 24767

View File

@ -11528,6 +11528,7 @@ get_symbol_version_string (Filedata * filedata,
if ((vers_data & VERSYM_HIDDEN) == 0 && vers_data == 0) if ((vers_data & VERSYM_HIDDEN) == 0 && vers_data == 0)
return NULL; return NULL;
*sym_info = (vers_data & VERSYM_HIDDEN) != 0 ? symbol_hidden : symbol_public;
max_vd_ndx = 0; max_vd_ndx = 0;
/* Usually we'd only see verdef for defined symbols, and verneed for /* Usually we'd only see verdef for defined symbols, and verneed for
@ -11593,15 +11594,11 @@ get_symbol_version_string (Filedata * filedata,
ivda.vda_name = BYTE_GET (evda.vda_name); ivda.vda_name = BYTE_GET (evda.vda_name);
if (psym->st_name != ivda.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 return (ivda.vda_name < strtab_size
? strtab + ivda.vda_name : _("<corrupt>")); ? strtab + ivda.vda_name : _("<corrupt>"));
} }
} }
} }
}
if (version_info[DT_VERSIONTAGIDX (DT_VERNEED)]) if (version_info[DT_VERSIONTAGIDX (DT_VERNEED)])
{ {