Skip to content

Commit

Permalink
[ruby/yarp] Handle bad input for ascii printable
Browse files Browse the repository at this point in the history
  • Loading branch information
kddnewton authored and matzbot committed Jun 29, 2023
1 parent a6cc1fa commit 26b69fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion yarp/unescape.c
Expand Up @@ -47,7 +47,8 @@ static const bool ascii_printable_chars[] = {

static inline bool
char_is_ascii_printable(const char c) {
return ascii_printable_chars[(unsigned char) c];
unsigned char v = (unsigned char) c;
return (v < 0x80) && ascii_printable_chars[v];
}

/******************************************************************************/
Expand Down

0 comments on commit 26b69fd

Please sign in to comment.