Skip to content

Commit 06242aa

Browse files
committed
Handle bad input for ascii printable
1 parent c0bb2af commit 06242aa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/unescape.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ static const bool ascii_printable_chars[] = {
4747

4848
static inline bool
4949
char_is_ascii_printable(const char c) {
50-
return ascii_printable_chars[(unsigned char) c];
50+
unsigned char v = (unsigned char) c;
51+
return (v < 0x80) && ascii_printable_chars[v];
5152
}
5253

5354
/******************************************************************************/

0 commit comments

Comments
 (0)