ICU-1923 fix buffer overrun when copying from temp buffer
X-SVN-Rev: 8770
This commit is contained in:
parent
0a70506190
commit
4f02d44cc3
@ -198,7 +198,10 @@ u_strCaseMap(UChar *dest, int32_t destCapacity,
|
||||
if(temp!=dest) {
|
||||
/* copy the result string to the destination buffer */
|
||||
if(destLength>0) {
|
||||
uprv_memmove(dest, temp, destLength*U_SIZEOF_UCHAR);
|
||||
int32_t copyLength= destLength<=destCapacity ? destLength : destCapacity;
|
||||
if(copyLength>0) {
|
||||
uprv_memmove(dest, temp, copyLength*U_SIZEOF_UCHAR);
|
||||
}
|
||||
}
|
||||
if(temp!=buffer) {
|
||||
uprv_free(temp);
|
||||
|
Loading…
Reference in New Issue
Block a user