aboutsummaryrefslogtreecommitdiff
path: root/editors/awk.c
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-05-09 21:57:23 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-05-09 21:57:23 +0000
commit4e6d123e4c230603640f4a5765b55109621b6823 (patch)
treeda613930899b3c3c5347e2cef0e9050c486dce36 /editors/awk.c
parentb0752f081e8296645e5ccf605e953b42993ef75c (diff)
downloadbusybox-w32-4e6d123e4c230603640f4a5765b55109621b6823.tar.gz
busybox-w32-4e6d123e4c230603640f4a5765b55109621b6823.tar.bz2
busybox-w32-4e6d123e4c230603640f4a5765b55109621b6823.zip
awk: don't segfault on printf(%*s). Close 1337.
git-svn-id: svn://busybox.net/trunk/busybox@18596 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'editors/awk.c')
-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)
1756 s = f; 1756 s = f;
1757 while (*f && (*f != '%' || *(++f) == '%')) 1757 while (*f && (*f != '%' || *(++f) == '%'))
1758 f++; 1758 f++;
1759 while (*f && !isalpha(*f)) 1759 while (*f && !isalpha(*f)) {
1760 if (*f == '*')
1761 syntax_error("%*x formats are not supported");
1760 f++; 1762 f++;
1763 }
1761 1764
1762 incr = (f - s) + MAXVARFMT; 1765 incr = (f - s) + MAXVARFMT;
1763 qrealloc(&b, incr + i, &bsize); 1766 qrealloc(&b, incr + i, &bsize);