Re: Unicode normalization SQL functions - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Unicode normalization SQL functions
Date
Msg-id 43f13518-010a-8319-8013-f319522ea719@2ndquadrant.com
Whole thread Raw
In response to Re: Unicode normalization SQL functions  ("Daniel Verite" <daniel@manitou-mail.org>)
Responses Re: Unicode normalization SQL functions
List pgsql-hackers
On 2020-01-28 10:48, Daniel Verite wrote:
> I found a bug in unicode_is_normalized_quickcheck() which is
> triggered when the last codepoint of the string is beyond
> U+10000. On encountering it, it does:
> +        if (is_supplementary_codepoint(ch))
> +            p++;
> When ch is the last codepoint, it makes p point to
> the ending zero, but the subsequent p++ done by
> the for loop makes it miss the exit and go into over-reading.
> 
> But anyway, what's the reason for skipping the codepoint
> following a codepoint outside of the BMP?

You're right, this didn't make any sense.  Here is a new patch set with 
that fixed.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: making the backend's json parser work in frontend code
Next
From: Stephen Frost
Date:
Subject: Re: Removing pg_pltemplate and creating "trustable" extensions