Commit | Line | Data |
---|---|---|
a4d266c2 VM |
1 | From fab4c3c719977205a3f005ddfd7fffbb9c19c587 Mon Sep 17 00:00:00 2001 |
2 | From: Frank Tang <ftang@chromium.org> | |
3 | Date: Wed, 30 Oct 2019 17:45:22 -0700 | |
4 | Subject: [PATCH] ICU-20884 initialized buffer uloc_getKeywordValue | |
5 | ||
6 | --- | |
7 | icu4c/source/common/uloc.cpp | 3 +++ | |
8 | 1 file changed, 3 insertions(+) | |
9 | ||
10 | diff --git a/icu4c/source/common/uloc.cpp b/icu4c/source/common/uloc.cpp | |
11 | index 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]; |