Blame SOURCES/ICU-20958-Prevent-SEGV_MAPERR-in-append.patch

2d07e8
diff -ru icu.orig/source/common/unistr.cpp icu/source/common/unistr.cpp
2d07e8
--- icu.orig/source/common/unistr.cpp	2019-04-12 00:11:18.000000000 +0200
2d07e8
+++ icu/source/common/unistr.cpp	2020-03-04 18:34:07.225801866 +0100
2d07e8
@@ -1340,7 +1340,10 @@
2d07e8
     if(srcLength == 0) {
2d07e8
       return *this;
2d07e8
     }
2d07e8
-    newLength = oldLength + srcLength;
2d07e8
+    if (uprv_add32_overflow(oldLength, srcLength, &newLength)) {
2d07e8
+      setToBogus();
2d07e8
+      return *this;
2d07e8
+    }
2d07e8
     if(newLength <= getCapacity() && isBufferWritable()) {
2d07e8
       UChar *oldArray = getArrayStart();
2d07e8
       // Do not copy characters when