v2-0001-Always-check-for-untermianted-strings-when-callin.patch
text/x-patch
Filename: v2-0001-Always-check-for-untermianted-strings-when-callin.patch
Type: text/x-patch
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v2-0001
Subject: Always check for untermianted strings when calling uloc_getLanguage()
| File | + | − |
|---|---|---|
| src/bin/initdb/initdb.c | 2 | 2 |
From 24bb803005d0af0bb371f22d0b6ac20fb50bdc0d Mon Sep 17 00:00:00 2001
From: Andreas Karlsson <andreas.karlsson@percona.com>
Date: Tue, 14 Apr 2026 02:12:15 +0200
Subject: [PATCH v2] Always check for untermianted strings when calling
uloc_getLanguage()
---
src/bin/initdb/initdb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 509f1114ef6..2ee834f0765 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -2403,7 +2403,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));
@@ -2423,7 +2423,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)
--
2.43.0