From 687ed05e55e5518fe48516f51bf82ec6d626cf6c Mon Sep 17 00:00:00 2001 From: Mike FABIAN Date: Sun, 22 Sep 2024 11:55:42 +0200 Subject: [PATCH] ICU-22913 Fix coverity warning in wrtxml.cpp See: https://unicode-org.atlassian.net/browse/ICU-22913 --- icu4c/source/tools/genrb/wrtxml.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icu4c/source/tools/genrb/wrtxml.cpp b/icu4c/source/tools/genrb/wrtxml.cpp index eba806117ab4..24ddf52e0789 100644 --- a/icu4c/source/tools/genrb/wrtxml.cpp +++ b/icu4c/source/tools/genrb/wrtxml.cpp @@ -187,7 +187,7 @@ static void strnrepchr(char* src, int32_t srcLen, char s, char r){ */ static char* parseFilename(const char* id, char* /*lang*/) { int idLen = static_cast(uprv_strlen(id)); - char* localeID = static_cast(uprv_malloc(idLen)); + char* localeID = static_cast(uprv_malloc(idLen+1)); int pos = 0; int canonCapacity = 0; char* canon = nullptr;