awk: fix read beyond end of buffer
No binary (build failed)
—
(log yok)
| @@ -2348,17 +2348,19 @@ static char *awk_printf(node *n, size_t *len) | |
| s = f; | |
| while (*f && *f != '%') | |
| f++; | |
| - | c = *++f; |
| - | if (c == '%') { /* double % */ |
| - | slen = f - s; |
| - | s = xstrndup(s, slen); |
| - | f++; |
| - | goto tail; |
| - | } |
| - | while (*f && !isalpha(*f)) { |
| - | if (*f == '*') |
| - | syntax_error("%*x formats are not supported"); |
| - | f++; |
| + | if (*f) { |
| + | c = *++f; |
| + | if (c == '%') { /* double % */ |
| + | slen = f - s; |
| + | s = xstrndup(s, slen); |
| + | f++; |
| + | goto tail; |
| + | } |
| + | while (*f && !isalpha(*f)) { |
| + | if (*f == '*') |
| + | syntax_error("%*x formats are not supported"); |
| + | f++; |
| + | } |
| } | |
| c = *f; | |
| if (!c) { | |