libelf: Fix handling of (extended) phnum.
authorMark Wielaard <mjw@redhat.com>
Sun, 16 Nov 2014 23:33:36 +0000 (00:33 +0100)
committerMark Wielaard <mjw@redhat.com>
Sun, 16 Nov 2014 23:33:36 +0000 (00:33 +0100)
commit436275edd015ab6a6f8e164ee2292f74f03d2413
tree3ae7d3d504f409719f7e3194b5121cfc1ccc8c32
parent2af7b4942ad1e08d6e0609afec4edc82588f089e
libelf: Fix handling of (extended) phnum.

If there is no e_phoff e_phnum cannot be trusted. Extended phnum can only
be gotten if we have an actual section table and a shdr for section zero,
Extended phnum can be too large to fit in the file (or a size_t).

Signed-off-by: Mark Wielaard <mjw@redhat.com>
libelf/ChangeLog
libelf/elf32_getphdr.c
libelf/elf_getphdrnum.c
src/ChangeLog
src/readelf.c