summaryrefslogtreecommitdiff
path: root/external/icu
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-06-19 23:05:42 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-06-19 23:05:42 +0200
commitd77c108922f7ea2c57bc63bbe289bba92f6213a6 (patch)
tree0715af276780da8b1879c9e751e111a261f45785 /external/icu
parentaca657b380477f122e1b541e6b0050f34bfc23de (diff)
external/icu: Change flexible array members to be of length 1 instead of 2
...so that -fsanitize=undefined does not report false out-of-bounds accesses; Clang's isFlexibleArrayMemberExpr (lib/CodeGen/CGExpr.cpp) only treats arrays of length 0 and 1 as such special flexible cases. There appears to be no code in icu that depends on those arrays to be of length 2 (e.g., via sizeof), though it does look suspicious that they are deliberately of length 2 instead of 1. Change-Id: I85293e769f1d64cb4e60e13f1cd7f88b76e37487
Diffstat (limited to 'external/icu')
-rw-r--r--external/icu/icu-ubsan.patch.022
1 files changed, 22 insertions, 0 deletions
diff --git a/external/icu/icu-ubsan.patch.0 b/external/icu/icu-ubsan.patch.0
index ef3121f88299..01fc290a2ae0 100644
--- a/external/icu/icu-ubsan.patch.0
+++ b/external/icu/icu-ubsan.patch.0
@@ -1,3 +1,25 @@
+--- source/common/rbbidata.h
++++ source/common/rbbidata.h
+@@ -113,7 +113,7 @@
+ /* StatusTable of the set of matching */
+ /* tags (rule status values) */
+ int16_t fReserved;
+- uint16_t fNextState[2]; /* Next State, indexed by char category. */
++ uint16_t fNextState[1]; /* Next State, indexed by char category. */
+ /* This array does not have two elements */
+ /* Array Size is actually fData->fHeader->fCatCount */
+ /* CAUTION: see RBBITableBuilder::getTableSize() */
+--- source/common/ucmndata.h
++++ source/common/ucmndata.h
+@@ -50,7 +50,7 @@
+
+ typedef struct {
+ uint32_t count;
+- UDataOffsetTOCEntry entry[2]; /* Actual size of array is from count. */
++ UDataOffsetTOCEntry entry[1]; /* Actual size of array is from count. */
+ } UDataOffsetTOC;
+
+ /**
--- source/common/ustring.cpp
+++ source/common/ustring.cpp
@@ -1486,7 +1486,7 @@