Skip to content

Commit

Permalink
ICU-23035 Fix bound check at u_strToPunycode
Browse files Browse the repository at this point in the history
  • Loading branch information
wooffie authored and markusicu committed Feb 7, 2025
1 parent db42c87 commit 40c3253
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion icu4c/source/common/punycode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ u_strToPunycode(const char16_t *src, int32_t srcLength,
return 0;
}

if(src==nullptr || srcLength<-1 || (dest==nullptr && destCapacity!=0)) {
if(src==nullptr || srcLength<-1 || destCapacity<0 || (dest==nullptr && destCapacity!=0)) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return 0;
}
Expand Down

0 comments on commit 40c3253

Please sign in to comment.