Re: Order changes in PG16 since ICU introduction - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Order changes in PG16 since ICU introduction
Date
Msg-id 504bc10a9ad8d143f505e66be2a0060e50b45677.camel@j-davis.com
Whole thread Raw
In response to Re: Order changes in PG16 since ICU introduction  (Alexander Lakhin <exclusion@gmail.com>)
List pgsql-hackers
On Tue, 2023-05-16 at 19:00 +0300, Alexander Lakhin wrote:
> I'm not sure about the proposed change in icu_from_uchar(). It seems
> that
> len_result + 1 bytes should always be enough for the result string
> terminated
> with NUL. If that's not true (we want to protect from some ICU bug
> here),
> then the change should be backpatched?

I believe it's enough and I'm not aware of any bug there so no backport
is required.

I added checks in places that were (a) checking for U_FAILURE; and (b)
expecting the result to be NUL-terminated. That's mostly callers of
uloc_getLanguage(), where I was not quite paranoid enough.

There were a couple other places though, and I went ahead and added
checks there out of paranoia, too. One was ucnv_fromUChars(), and the
other was uloc_canonicalize().

Regards,
    Jeff Davis




pgsql-hackers by date:

Previous
From: Alexander Lakhin
Date:
Subject: Re: Order changes in PG16 since ICU introduction
Next
From: "Joel Jacobson"
Date:
Subject: Re: Should CSV parsing be stricter about mid-field quotes?