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(-)
From a11c996d9648372aa8355ca73fbec15b1f0f1ba6 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Thu, 12 Mar 2020 18:08:24 -0700
Subject: [PATCH] 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);
         }
-- 
2.25.1.481.gfbce0eb801-goog

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to