CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
nspr: updated to 4.34.1
[ports/opt-arm.git] / icu / icu-65.1-initialized-buffer-uloc_getKeywordValue.patch
CommitLineData
a4d266c2
VM
1From fab4c3c719977205a3f005ddfd7fffbb9c19c587 Mon Sep 17 00:00:00 2001
2From: Frank Tang <ftang@chromium.org>
3Date: Wed, 30 Oct 2019 17:45:22 -0700
4Subject: [PATCH] ICU-20884 initialized buffer uloc_getKeywordValue
5
6---
7 icu4c/source/common/uloc.cpp | 3 +++
8 1 file changed, 3 insertions(+)
9
10diff --git a/icu4c/source/common/uloc.cpp b/icu4c/source/common/uloc.cpp
11index 6a9bfcfbff5..ea81c0ce87f 100644
12--- a/icu4c/source/common/uloc.cpp
13+++ b/icu4c/source/common/uloc.cpp
14@@ -766,6 +766,9 @@ uloc_getKeywordValue(const char* localeID,
15 char* buffer, int32_t bufferCapacity,
16 UErrorCode* status)
17 {
18+ if (buffer != nullptr) {
19+ buffer[0] = '\0';
20+ }
21 const char* startSearchHere = NULL;
22 const char* nextSeparator = NULL;
23 char keywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];