From: Denis Vlasenko Date: Wed, 9 May 2007 21:57:23 +0000 (-0000) Subject: awk: don't segfault on printf(%*s). Close 1337. X-Git-Tag: 1_6_0~76 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=389f9d52d5520dea157fab474caacf3d8b1bde73;p=oweals%2Fbusybox.git awk: don't segfault on printf(%*s). Close 1337. --- diff --git a/editors/awk.c b/editors/awk.c index bc9e99a6f..2e67f67fb 100644 --- a/editors/awk.c +++ b/editors/awk.c @@ -1756,8 +1756,11 @@ static char *awk_printf(node *n) s = f; while (*f && (*f != '%' || *(++f) == '%')) f++; - while (*f && !isalpha(*f)) + while (*f && !isalpha(*f)) { + if (*f == '*') + syntax_error("%*x formats are not supported"); f++; + } incr = (f - s) + MAXVARFMT; qrealloc(&b, incr + i, &bsize);