ICU-3862 fix memory problem in ucol_elm
X-SVN-Rev: 16759
This commit is contained in:
parent
6c0d288270
commit
59ccce5787
@ -496,9 +496,9 @@ static int uprv_uca_setMaxExpansion(uint32_t endexpansion,
|
||||
uint8_t *sizeshiftpos = pexpansionsize + (shiftpos - pendexpansionce);
|
||||
|
||||
/* okay need to rearrange the array into sorted order */
|
||||
if (shiftsize == 0 || *(pendexpansionce + pos) < endexpansion) {
|
||||
*(pendexpansionce + pos + 1) = endexpansion;
|
||||
*(pexpansionsize + pos + 1) = expansionsize;
|
||||
if (shiftsize == 0 /*|| *(pendexpansionce + pos) < endexpansion*/) { /* the commented part is actually both redundant and dangerous */
|
||||
*(pendexpansionce + pos) = endexpansion;
|
||||
*(pexpansionsize + pos) = expansionsize;
|
||||
}
|
||||
else {
|
||||
uprv_memmove(shiftpos + 1, shiftpos, shiftsize * sizeof(int32_t));
|
||||
|
Loading…
Reference in New Issue
Block a user