pgsql: ICU: check for U_STRING_NOT_TERMINATED_WARNING. - Mailing list pgsql-committers

From Jeff Davis
Subject pgsql: ICU: check for U_STRING_NOT_TERMINATED_WARNING.
Date
Msg-id E1pzOct-000OX3-HO@gemulon.postgresql.org
Whole thread Raw
List 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(-)


pgsql-committers by date:

Previous
From: Jeff Davis
Date:
Subject: pgsql: Reduce icu_validation_level default to WARNING.
Next
From: Tom Lane
Date:
Subject: pgsql: Tweak API of new function clause_is_computable_at().