When building with gcc -Os it seems we can inline read_number_entries
but if that function fails then n will not be initialized. GCC seems not
to realize that in that case n won't be used at all. Explicitly initialize
n to zero to prevent a spurious error: 'n' may be used uninitialized in
this function [-Werror=maybe-uninitialized] in that case.
https://sourceware.org/bugzilla/show_bug.cgi?id=21011
Signed-off-by: Mark Wielaard <mark@klomp.org>
+2017-04-19 Mark Wielaard <mark@klomp.org>
+
+ * elf_getarsym.c (elf_getarsym): Initialize n to zero.
+
2017-03-27 Mark Wielaard <mark@klomp.org>
* elf32_updatefile.c (updatemmap): Always update last_positition.
/* We have an archive. The first word in there is the number of
entries in the table. */
- uint64_t n;
+ uint64_t n = 0;
size_t off = elf->start_offset + SARMAG + sizeof (struct ar_hdr);
if (read_number_entries (&n, elf, &off, index64_p) < 0)
{