ICU-7651 Fix incorrect size calculation of fSmallData in regex.

X-SVN-Rev: 27992
This commit is contained in:
Michael Ow 2010-04-28 02:32:00 +00:00
parent 70c95242a2
commit 7058d05758

View File

@ -243,7 +243,7 @@ void RegexMatcher::init2(UText *input, UErrorCode &status) {
return;
}
if (fPattern->fDataSize > (int32_t)(sizeof(fSmallData)/sizeof(int32_t))) {
if (fPattern->fDataSize > (int32_t)(sizeof(fSmallData)/sizeof(fSmallData[0]))) {
fData = (int64_t *)uprv_malloc(fPattern->fDataSize * sizeof(int64_t));
if (fData == NULL) {
status = fDeferredStatus = U_MEMORY_ALLOCATION_ERROR;