From: Denys Vlasenko Date: Thu, 8 Mar 2012 02:50:01 +0000 (+0100) Subject: test: "test !" was accessing argv past NULL - fix it. Closes 4832 X-Git-Tag: 1_20_0~33 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=07fcaab595e9029ebe37f5240a10038c493af545;p=oweals%2Fbusybox.git test: "test !" was accessing argv past NULL - fix it. Closes 4832 Signed-off-by: Denys Vlasenko --- diff --git a/coreutils/test.c b/coreutils/test.c index 1f5398ad8..0bc008e7c 100644 --- a/coreutils/test.c +++ b/coreutils/test.c @@ -710,7 +710,8 @@ static number_t nexpr(enum token n) if (n == EOI) { /* special case: [ ! ], [ a -a ! ] are valid */ /* IOW, "! ARG" may miss ARG */ - unnest_msg("aexpr(%s)\n", TOKSTR[n]); res = nexpr(n); - dbg_msg("aexpr: nexpr:%lld, next args:%s\n", res, args[1]); + dbg_msg("aexpr: nexpr:%lld, next args:%s(%p)\n", res, args[1], &args[1]); if (check_operator(*++args) == BAND) { - dbg_msg("aexpr: arg is AND, next args:%s\n", args[1]); + dbg_msg("aexpr: arg is AND, next args:%s(%p)\n", args[1], &args[1]); res = aexpr(check_operator(*++args)) && res; unnest_msg("oexpr(%s)\n", TOKSTR[n]); res = aexpr(n); - dbg_msg("oexpr: aexpr:%lld, next args:%s\n", res, args[1]); + dbg_msg("oexpr: aexpr:%lld, next args:%s(%p)\n", res, args[1], &args[1]); if (check_operator(*++args) == BOR) { - dbg_msg("oexpr: next arg is OR, next args:%s\n", args[1]); + dbg_msg("oexpr: next arg is OR, next args:%s(%p)\n", args[1], &args[1]); res = oexpr(check_operator(*++args)) || res; unnest_msg("