From 59ccce578704e8a7b63a1cc11ac67982e339a0ea Mon Sep 17 00:00:00 2001 From: Vladimir Weinstein Date: Thu, 4 Nov 2004 23:26:37 +0000 Subject: [PATCH] ICU-3862 fix memory problem in ucol_elm X-SVN-Rev: 16759 --- icu4c/source/i18n/ucol_elm.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/icu4c/source/i18n/ucol_elm.cpp b/icu4c/source/i18n/ucol_elm.cpp index fe4a982c6f..e81d555713 100644 --- a/icu4c/source/i18n/ucol_elm.cpp +++ b/icu4c/source/i18n/ucol_elm.cpp @@ -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));