public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 1/1] libcpp: allow UCS_LIMIT codepoints in UTF-8 strings
@ 2023-06-21 18:58 Ben Boeckel
  2023-06-23 20:05 ` Jason Merrill
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Boeckel @ 2023-06-21 18:58 UTC (permalink / raw)
  To: gcc-patches; +Cc: Ben Boeckel, jason, gcc, brad.king, Damien Guibouret

libcpp/

	* charset.cc: Allow `UCS_LIMIT` in UTF-8 strings.

Reported-by: Damien Guibouret <damien.guibouret@partition-saving.com>
Fixes: c1dbaa6656a (libcpp: reject codepoints above 0x10FFFF, 2023-06-06)
Signed-off-by: Ben Boeckel <ben.boeckel@kitware.com>
---
 libcpp/charset.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcpp/charset.cc b/libcpp/charset.cc
index d4f573e365f..54ebab2b8a4 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.  */
-- 
2.40.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] libcpp: allow UCS_LIMIT codepoints in UTF-8 strings
  2023-06-21 18:58 [PATCH 1/1] libcpp: allow UCS_LIMIT codepoints in UTF-8 strings Ben Boeckel
@ 2023-06-23 20:05 ` Jason Merrill
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Merrill @ 2023-06-23 20:05 UTC (permalink / raw)
  To: Ben Boeckel, gcc-patches; +Cc: Ben Boeckel, gcc, brad.king, Damien Guibouret

On 6/21/23 14:58, Ben Boeckel wrote:
> libcpp/
> 
> 	* charset.cc: Allow `UCS_LIMIT` in UTF-8 strings.
> 
> Reported-by: Damien Guibouret <damien.guibouret@partition-saving.com>
> Fixes: c1dbaa6656a (libcpp: reject codepoints above 0x10FFFF, 2023-06-06)
> Signed-off-by: Ben Boeckel <ben.boeckel@kitware.com>

Applied, moving the Fixes line up and changing the commit ID to the git 
gcc-descr version.  Thanks.

> ---
>   libcpp/charset.cc | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libcpp/charset.cc b/libcpp/charset.cc
> index d4f573e365f..54ebab2b8a4 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.  */


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-23 20:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-21 18:58 [PATCH 1/1] libcpp: allow UCS_LIMIT codepoints in UTF-8 strings Ben Boeckel
2023-06-23 20:05 ` Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).