[git commit] ash: Avoid overflow for very long variable name

Denys Vlasenko vda.linux at googlemail.com
Fri Sep 30 09:35:54 UTC 2016


commit: https://git.busybox.net/busybox/commit/?id=50e6d42c1967cbd3b07441876af2a7ff2bbbf63f
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Upstream commit:

    Date: Tue, 3 Jul 2012 17:32:33 +0800
    Avoid overflow for very long variable name

    Otherwise, this:
      $ perl -le 'print "v"x(2**31+1) ."=1"' | dash
    provokes integer overflow

    Signed-off-by: Jim Meyering <meyering at redhat.com>
    Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/ash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shell/ash.c b/shell/ash.c
index 59905aa..a1b211a 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -11274,7 +11274,7 @@ readtoken1(int c, int syntax, char *eofmark, int striptabs)
 	/* NB: syntax parameter fits into smallint */
 	/* c parameter is an unsigned char or PEOF or PEOA */
 	char *out;
-	int len;
+	size_t len;
 	char line[EOFMARKLEN + 1];
 	struct nodelist *bqlist;
 	smallint quotef;


More information about the busybox-cvs mailing list