aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-05-09 21:57:23 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-05-09 21:57:23 +0000
commit389f9d52d5520dea157fab474caacf3d8b1bde73 (patch)
treeda613930899b3c3c5347e2cef0e9050c486dce36 /editors
parent57bf668d118804060cee998408bdfbfb5512e670 (diff)
downloadbusybox-389f9d52d5520dea157fab474caacf3d8b1bde73.tar.gz
awk: don't segfault on printf(%*s). Close 1337.
Diffstat (limited to 'editors')
-rw-r--r--editors/awk.c5
1 files changed, 4 insertions, 1 deletions
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);