summaryrefslogtreecommitdiff
path: root/chromium/third_party/icu/source/common/unistr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/icu/source/common/unistr.cpp')
-rw-r--r--chromium/third_party/icu/source/common/unistr.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/chromium/third_party/icu/source/common/unistr.cpp b/chromium/third_party/icu/source/common/unistr.cpp
index 8f065158654..61f471da40e 100644
--- a/chromium/third_party/icu/source/common/unistr.cpp
+++ b/chromium/third_party/icu/source/common/unistr.cpp
@@ -1563,7 +1563,11 @@ UnicodeString::doAppend(const UChar *srcChars, int32_t srcStart, int32_t srcLeng
}
int32_t oldLength = length();
- int32_t newLength = oldLength + srcLength;
+ int32_t newLength;
+ if (uprv_add32_overflow(oldLength, srcLength, &newLength)) {
+ setToBogus();
+ return *this;
+ }
// Check for append onto ourself
const UChar* oldArray = getArrayStart();