← Commit list

305a30d80

Ron Yorston
Ron Yorston
2021-09-09
SUCCESS Duration: 153s

Subject

awk: fix read beyond end of buffer

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

editors/awk.c+13 -11
@@ -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) {