From f1142e5b6d86eb918bd0176b28544e6110bc9e2f Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 12 Mar 2020 18:08:24 -0700 Subject: readelf: fix interpreter name length check. Looks like I left off half way through this! Also default readelf to n while it's still in pending. --- toys/pending/readelf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toys/pending/readelf.c b/toys/pending/readelf.c index ef888c07..5cd148c1 100644 --- a/toys/pending/readelf.c +++ b/toys/pending/readelf.c @@ -8,7 +8,7 @@ USE_READELF(NEWTOY(readelf, "<1(dyn-syms)adehlnp:SsWx:", TOYFLAG_USR|TOYFLAG_BIN config READELF bool "readelf" - default y + default n help usage: readelf [-adehlnSs] [-p SECTION] [-x SECTION] [file...] @@ -458,7 +458,7 @@ static void scan_elf() ph_type(ph.type), ph.offset, w, ph.vaddr, w, ph.paddr, ph.filesz, ph.memsz, ph.flags&4?'R':' ', ph.flags&2?'W':' ', ph.flags&1?'E':' ', ph.align); - if (ph.type == 3 /*PH_INTERP*/ && ph.filesz && ph.filesz) { + if (ph.type == 3 /*PH_INTERP*/ && ph.filesz - 1 < TT.size - ph.offset) { printf(" [Requesting program interpreter: %*s]\n", (int) ph.filesz-1, TT.elf+ph.offset); } -- cgit v1.2.3