summaryrefslogtreecommitdiff
path: root/external/icu
diff options
context:
space:
mode:
Diffstat (limited to 'external/icu')
-rw-r--r--external/icu/icu-ubsan.patch.025
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 @@