Skip to content

Commit 40c3253

Browse files
wooffiemarkusicu
authored andcommitted
ICU-23035 Fix bound check at u_strToPunycode
1 parent db42c87 commit 40c3253

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

icu4c/source/common/punycode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ u_strToPunycode(const char16_t *src, int32_t srcLength,
193193
return 0;
194194
}
195195

196-
if(src==nullptr || srcLength<-1 || (dest==nullptr && destCapacity!=0)) {
196+
if(src==nullptr || srcLength<-1 || destCapacity<0 || (dest==nullptr && destCapacity!=0)) {
197197
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
198198
return 0;
199199
}

0 commit comments

Comments
 (0)