mirror of
https://github.com/postgres/postgres.git
synced 2026-04-15 22:10:45 -04:00
Check for unterminated strings when calling uloc_getLanguage().
Missed by commit 1671f990dd.
Author: Andreas Karlsson <andreas@proxel.se>
Discussion: https://postgr.es/m/118ca69e-47eb-42e1-83e9-72ccf40dd6fd@proxel.se
Backpatch-through: 16
This commit is contained in:
parent
42473d9009
commit
ca938ec213
1 changed files with 2 additions and 2 deletions
|
|
@ -2380,7 +2380,7 @@ icu_validate_locale(const char *loc_str)
|
|||
/* validate that we can extract the language */
|
||||
status = U_ZERO_ERROR;
|
||||
uloc_getLanguage(loc_str, lang, ULOC_LANG_CAPACITY, &status);
|
||||
if (U_FAILURE(status))
|
||||
if (U_FAILURE(status) || status == U_STRING_NOT_TERMINATED_WARNING)
|
||||
{
|
||||
pg_fatal("could not get language from locale \"%s\": %s",
|
||||
loc_str, u_errorName(status));
|
||||
|
|
@ -2400,7 +2400,7 @@ icu_validate_locale(const char *loc_str)
|
|||
|
||||
status = U_ZERO_ERROR;
|
||||
uloc_getLanguage(otherloc, otherlang, ULOC_LANG_CAPACITY, &status);
|
||||
if (U_FAILURE(status))
|
||||
if (U_FAILURE(status) || status == U_STRING_NOT_TERMINATED_WARNING)
|
||||
continue;
|
||||
|
||||
if (strcmp(lang, otherlang) == 0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue