From 26b69fd4071b88c24654b19109beeb2ee416c0fa Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 28 Jun 2023 21:04:19 -0400 Subject: [PATCH] [ruby/yarp] Handle bad input for ascii printable https://github.com/ruby/yarp/commit/06242aa7a0 --- yarp/unescape.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yarp/unescape.c b/yarp/unescape.c index 716452e0f4..a47e49ac10 100644 --- a/yarp/unescape.c +++ b/yarp/unescape.c @@ -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]; } /******************************************************************************/