blob: 433ed21d8013700902a94410e26be414e3cdfb47 [file] [log] [blame]
diff --git a/source/common/uloc.cpp b/source/common/uloc.cpp
index 6a9bfcfb..ea81c0ce 100644
--- a/source/common/uloc.cpp
+++ b/source/common/uloc.cpp
@@ -766,6 +766,9 @@ uloc_getKeywordValue(const char* localeID,
char* buffer, int32_t bufferCapacity,
UErrorCode* status)
{
+ if (buffer != nullptr) {
+ buffer[0] = '\0';
+ }
const char* startSearchHere = NULL;
const char* nextSeparator = NULL;
char keywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];