From: Ben Boeckel Date: Wed, 21 Jun 2023 18:58:20 +0000 (-0400) Subject: libcpp: allow UCS_LIMIT codepoints in UTF-8 strings X-Git-Tag: basepoints/gcc-15~8086 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7fc0a3be52f78100a270b63e7555fde078fd2e3;p=thirdparty%2Fgcc.git libcpp: allow UCS_LIMIT codepoints in UTF-8 strings Fixes r14-1954 (libcpp: reject codepoints above 0x10FFFF, 2023-06-06) libcpp/ * charset.cc: Allow `UCS_LIMIT` in UTF-8 strings. Reported-by: Damien Guibouret Signed-off-by: Ben Boeckel --- diff --git a/libcpp/charset.cc b/libcpp/charset.cc index d492f66adbc9..7b625c9956a6 100644 --- a/libcpp/charset.cc +++ b/libcpp/charset.cc @@ -1891,7 +1891,7 @@ cpp_valid_utf8_p (const char *buffer, size_t num_bytes) invalid because they cannot be represented in UTF-16. Reject such values.*/ - if (cp >= UCS_LIMIT) + if (cp > UCS_LIMIT) return false; } /* No problems encountered. */