diff options
author | Ben Boeckel <me@benboeckel.net> | 2023-06-21 14:58:20 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2023-06-23 16:04:12 -0400 |
commit | b7fc0a3be52f78100a270b63e7555fde078fd2e3 (patch) | |
tree | d94a9cfecaa531316e45c2991bfaee13c569c2ce /libcpp/charset.cc | |
parent | dd2eb972a5b063e10c83878d5c9336a818fa8291 (diff) | |
download | gcc-b7fc0a3be52f78100a270b63e7555fde078fd2e3.zip gcc-b7fc0a3be52f78100a270b63e7555fde078fd2e3.tar.gz gcc-b7fc0a3be52f78100a270b63e7555fde078fd2e3.tar.bz2 |
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 <damien.guibouret@partition-saving.com>
Signed-off-by: Ben Boeckel <ben.boeckel@kitware.com>
Diffstat (limited to 'libcpp/charset.cc')
-rw-r--r-- | libcpp/charset.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libcpp/charset.cc b/libcpp/charset.cc index d492f66..7b625c9 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. */ |