Re: Speed up ICU case conversion by using ucasemap_utf8To*() - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Speed up ICU case conversion by using ucasemap_utf8To*()
Date
Msg-id 84006e443ef2dcfcbff8dcb3814c0c402b8ff7fd.camel@j-davis.com
Whole thread Raw
In response to Re: Speed up ICU case conversion by using ucasemap_utf8To*()  (Andreas Karlsson <andreas@proxel.se>)
Responses Re: Speed up ICU case conversion by using ucasemap_utf8To*()
List pgsql-hackers
On Wed, 2026-04-01 at 02:46 +0200, Andreas Karlsson wrote:
> On 3/12/26 5:00 AM, Alexander Lakhin wrote:
> > I've discovered that starting from c4ff35f10, the following query:
> > CREATE COLLATION c (provider = icu, locale = 'icu_something');
> >
> > makes asan detect (maybe dubious, but still..) stack-buffer-
> > overflow:
> > ==21963==ERROR: AddressSanitizer: stack-buffer-overflow on address
>
> My proposed fix is that we allocate a ULOC_LANG_CAPACITY buffer for
> the
> language like we do in fix_icu_locale_str() instead of trying to be
> clever.

Thank you both!

Committed with minor revisions:

* also check the status code, just to be sure
* backport to 18 where the original code was introduced

Regards,
    Jeff Davis




pgsql-hackers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: Reduce build times of pg_trgm GIN indexes
Next
From: Andres Freund
Date:
Subject: Re: test_compression, test module for low-level compression APIs (for 2b5ba2a0a141)