Disallow "\x00"

This commit is contained in:
Dianne Skoll
2025-02-01 10:12:51 -05:00
parent 5c965e2083
commit ca56b4c90e
2 changed files with 12 additions and 2 deletions
+6 -1
View File
@@ -1651,7 +1651,12 @@ static int parse_expr_token(DynamicBuffer *buf, char const **in)
(*in)++;
}
c2 = (int) strtol(hexbuf, NULL, 16);
r = DBufPutc(buf, c2);
if (!c2) {
Eprint(tr("\\x00 is not a valid escape sequence"));
r = E_PARSE_ERR;
} else {
r = DBufPutc(buf, c2);
}
break;
default:
r = DBufPutc(buf, **in);