From b11567abc808a4524dd943b84b1eb289e69de5f6 Mon Sep 17 00:00:00 2001 From: Syn Wee Quek Date: Thu, 13 Feb 2003 23:34:01 +0000 Subject: [PATCH] ICU-2204 array bounds checking error fix X-SVN-Rev: 11037 --- icu4c/source/i18n/ucol.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/icu4c/source/i18n/ucol.cpp b/icu4c/source/i18n/ucol.cpp index 0a584cfbb6..c16008ef8c 100644 --- a/icu4c/source/i18n/ucol.cpp +++ b/icu4c/source/i18n/ucol.cpp @@ -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; }