We sanity check to make sure we don't index outside the chain array
by testing inner > max_nsyms. But inner is a zero-based index, while
max_nsyms is the maximum number. Change the check to inner >= max_nsyms.
https://sourceware.org/bugzilla/show_bug.cgi?id=21299
Signed-off-by: Mark Wielaard <mark@klomp.org>
+2017-03-24 Mark Wielaard <mjw@redhat.com>
+
+ * readelf.c (handle_gnu_hash): Check inner < max_nsyms before
+ indexing into chain array.
+
2017-02-16 Ulf Hermann <ulf.hermann@qt.io>
* addr2line.c: Include printversion.h
++nsyms;
if (maxlength < ++lengths[cnt])
++maxlength;
- if (inner > max_nsyms)
+ if (inner >= max_nsyms)
goto invalid_data;
}
while ((chain[inner++] & 1) == 0);