summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/icu/patches/ubrk.patch
blob: 51213fd80783652c5395b62087d48b3fcdd456ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Index: source/common/ubrk.cpp
===================================================================
--- source/common/ubrk.cpp	(revision 120256)
+++ source/common/ubrk.cpp	(working copy)
@@ -166,6 +166,13 @@
              int32_t         textLength,
              UErrorCode*     status)
 {
+    if (bi == NULL) {
+        if (U_SUCCESS(*status)) {
+            *status = U_ILLEGAL_ARGUMENT_ERROR;
+        }
+        return;
+    }
+
     BreakIterator *brit = (BreakIterator *)bi;
     UText  ut = UTEXT_INITIALIZER;
     utext_openUChars(&ut, text, textLength, status);
@@ -181,6 +188,13 @@
              UText          *text,
              UErrorCode     *status)
 {
+    if (bi == NULL) {
+        if (U_SUCCESS(*status)) {
+            *status = U_ILLEGAL_ARGUMENT_ERROR;
+        }
+        return;
+    }
+
     RuleBasedBreakIterator *brit = (RuleBasedBreakIterator *)bi;
     brit->RuleBasedBreakIterator::setText(text, *status);
 }