safe_u8putstr: handle NUL bytes

These have length 0, but we still want to progress one byte.
Found by duncaen with afl-fuzz.
pull/147/head
Leah Neukirchen 6 years ago
parent 2069a0e913
commit 188aeac3e1

@ -36,6 +36,9 @@ safe_u8putstr(char *s0, size_t l, FILE *stream)
}
} else if (c < 32 &&
*s != ' ' && *s != '\t' && *s != '\n' && *s != '\r') {
// NUL
if (l == 0)
l = 1;
// C0
fputc(0xe2, stream);
fputc(0x90, stream);

Loading…
Cancel
Save