From: Frank Tang Date: Tue, 18 Aug 2020 22:36:00 +0000 (+0000) Subject: ICU-21157 Fix incorrect null termination. X-Git-Tag: cldr/2020-09-22~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cde54fc5ba1581061cc31c158967ab6b074df3ab;p=icu ICU-21157 Fix incorrect null termination. See #1236 --- diff --git a/icu4c/source/common/locdispnames.cpp b/icu4c/source/common/locdispnames.cpp index 0255d30da8a..655c32ba8d1 100644 --- a/icu4c/source/common/locdispnames.cpp +++ b/icu4c/source/common/locdispnames.cpp @@ -733,7 +733,7 @@ uloc_getDisplayName(const char *locale, int32_t padLen; patPos+=subLen; padLen=(subi==0 ? sub1Pos : patLen)-patPos; - if(length+padLen < destCapacity) { + if(length+padLen <= destCapacity) { p=dest+length; for(int32_t i=0;i