mirror of
https://github.com/postgres/postgres.git
synced 2026-06-08 16:26:30 -04:00
Fix overrun when comparing with unterminated ICU language string.
The overrun was introduced in commit c4ff35f10.
Author: Andreas Karlsson <andreas@proxel.se>
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://postgr.es/m/96d80a47-f17f-42fa-82b1-2908efbd6541@gmail.com
Backpatch-through: 18
This commit is contained in:
parent
e89f98ff03
commit
06ce97b999
1 changed files with 3 additions and 3 deletions
|
|
@ -989,11 +989,11 @@ static int32_t
|
|||
foldcase_options(const char *locale)
|
||||
{
|
||||
uint32 options = U_FOLD_CASE_DEFAULT;
|
||||
char lang[3];
|
||||
char lang[ULOC_LANG_CAPACITY];
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
uloc_getLanguage(locale, lang, 3, &status);
|
||||
if (U_SUCCESS(status))
|
||||
uloc_getLanguage(locale, lang, ULOC_LANG_CAPACITY, &status);
|
||||
if (U_SUCCESS(status) && status != U_STRING_NOT_TERMINATED_WARNING)
|
||||
{
|
||||
/*
|
||||
* The option name is confusing, but it causes u_strFoldCase to use
|
||||
|
|
|
|||
Loading…
Reference in a new issue