ICU-2204 array bounds checking error fix

X-SVN-Rev: 11037
This commit is contained in:
Syn Wee Quek 2003-02-13 23:34:01 +00:00
parent c60e812576
commit b11567abc8

View File

@ -5761,9 +5761,9 @@ ucol_getBound(const uint8_t *source,
noOfLevels--;
}
} while (noOfLevels > 0
&& (source[sourceIndex] != 0 || sourceIndex == sourceLength));
&& (source[sourceIndex] != 0 || sourceIndex < sourceLength));
if((source[sourceIndex] != 0 || sourceIndex == sourceLength)
if((source[sourceIndex] == 0 || sourceIndex == sourceLength)
&& noOfLevels > 0) {
*status = U_SORT_KEY_TOO_SHORT_WARNING;
}