pgsql: ICU: check for U_STRING_NOT_TERMINATED_WARNING.

From: Jeff Davis <jdavis(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: ICU: check for U_STRING_NOT_TERMINATED_WARNING.
Date: 2023-05-17 21:24:03
Message-ID: E1pzOct-000OX3-HO@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

ICU: check for U_STRING_NOT_TERMINATED_WARNING.

Fixes memory error in cases where the length of the language name
returned by uloc_getLanguage() is exactly ULOC_LANG_CAPACITY, in which
case the status is set to U_STRING_NOT_TERMINATED_WARNING.

Also check in call sites for other ICU functions that are expected to
return a C string to be safe (no bug is known at these other call
sites).

Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/2098874d-c111-41e4-9063-30bcf135226b@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1c634f6647c28354258d114041252475325aea32

Modified Files
--------------
src/backend/utils/adt/pg_locale.c | 29 +++++++++++------------------
src/bin/initdb/initdb.c | 15 ++++-----------
2 files changed, 15 insertions(+), 29 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2023-05-17 21:51:41 Re: issue with meson builds on msys2
Previous Message Jeff Davis 2023-05-17 20:40:55 pgsql: Reduce icu_validation_level default to WARNING.