diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-08-28 15:51:10 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-08-28 15:52:21 +0100 |
commit | 7890a7263f8a6740582bc58328c76613818fe2d5 (patch) | |
tree | d7a17439d32bfcb1c6aa6037f995c8fad2180045 /external/icu | |
parent | 5253732ca6ff31f3cce9e1ad3c65a48db721e966 (diff) |
update getTableSize (and fRowLen) for dodgy 2-based arithmetic
Change-Id: I3787a46cf8662ed709534db85d724c17c21b90dd
Diffstat (limited to 'external/icu')
-rw-r--r-- | external/icu/icu-ubsan.patch.0 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/external/icu/icu-ubsan.patch.0 b/external/icu/icu-ubsan.patch.0 index 01fc290a2ae0..5f9e85f502eb 100644 --- a/external/icu/icu-ubsan.patch.0 +++ b/external/icu/icu-ubsan.patch.0 @@ -9,6 +9,31 @@ /* This array does not have two elements */ /* Array Size is actually fData->fHeader->fCatCount */ /* CAUTION: see RBBITableBuilder::getTableSize() */ +--- source/common/rbbitblb.cpp ++++ source/common/rbbitblb.cpp +@@ -1072,10 +1072,10 @@ + numRows = fDStates->size(); + numCols = fRB->fSetBuilder->getNumCharCategories(); + +- // Note The declaration of RBBIStateTableRow is for a table of two columns. +- // Therefore we subtract two from numCols when determining ++ // Note The declaration of RBBIStateTableRow is for a table of one columns. ++ // Therefore we subtract one from numCols when determining + // how much storage to add to a row for the total columns. +- rowSize = sizeof(RBBIStateTableRow) + sizeof(uint16_t)*(numCols-2); ++ rowSize = sizeof(RBBIStateTableRow) + sizeof(uint16_t)*(numCols-1); + size += numRows * rowSize; + return size; + } +@@ -1105,7 +1105,7 @@ + } + + table->fRowLen = sizeof(RBBIStateTableRow) + +- sizeof(uint16_t) * (fRB->fSetBuilder->getNumCharCategories() - 2); ++ sizeof(uint16_t) * (fRB->fSetBuilder->getNumCharCategories() - 1); + table->fNumStates = fDStates->size(); + table->fFlags = 0; + if (fRB->fLookAheadHardBreak) { --- source/common/ucmndata.h +++ source/common/ucmndata.h @@ -50,7 +50,7 @@ |