diff --git a/libs/icu/Makefile b/libs/icu/Makefile index 459e5a6be5..43b7ad034e 100644 --- a/libs/icu/Makefile +++ b/libs/icu/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=icu4c MAJOR_VERSION:=68 MINOR_VERSION:=2 PKG_VERSION:=$(MAJOR_VERSION).$(MINOR_VERSION) -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(MAJOR_VERSION)_$(MINOR_VERSION)-src.tgz PKG_SOURCE_URL:=https://github.com/unicode-org/icu/releases/download/release-$(MAJOR_VERSION)-$(MINOR_VERSION) diff --git a/libs/icu/patches/999-CVE-2021-30535.patch b/libs/icu/patches/999-CVE-2021-30535.patch new file mode 100644 index 0000000000..0b941d0687 --- /dev/null +++ b/libs/icu/patches/999-CVE-2021-30535.patch @@ -0,0 +1,47 @@ +From e450fa50fc242282551f56b941dc93b9a8a0bcbb Mon Sep 17 00:00:00 2001 +From: Frank Tang +Date: Tue, 13 Apr 2021 15:16:50 -0700 +Subject: [PATCH] ICU-21587 Fix memory bug w/ baseName + +Edge cases not fixed in assign and move assign operator +while the locale is long and call setKeywordValue with incorrect +keyword/values. +--- + icu4c/source/common/locid.cpp | 11 +++++++++-- + icu4c/source/test/intltest/loctest.cpp | 26 ++++++++++++++++++++++++++ + icu4c/source/test/intltest/loctest.h | 2 ++ + 3 files changed, 37 insertions(+), 2 deletions(-) + +--- a/common/locid.cpp ++++ b/common/locid.cpp +@@ -469,14 +469,18 @@ Locale& Locale::operator=(Locale&& other + if (baseName != fullName) uprv_free(baseName); + if (fullName != fullNameBuffer) uprv_free(fullName); + +- if (other.fullName == other.fullNameBuffer) { ++ if (other.fullName == other.fullNameBuffer || other.baseName == other.fullNameBuffer) { + uprv_strcpy(fullNameBuffer, other.fullNameBuffer); ++ } ++ if (other.fullName == other.fullNameBuffer) { + fullName = fullNameBuffer; + } else { + fullName = other.fullName; + } + +- if (other.baseName == other.fullName) { ++ if (other.baseName == other.fullNameBuffer) { ++ baseName = fullNameBuffer; ++ } else if (other.baseName == other.fullName) { + baseName = fullName; + } else { + baseName = other.baseName; +@@ -2478,6 +2482,9 @@ Locale::setKeywordValue(const char* keyw + if (fullName != fullNameBuffer) { + // if full Name is already on the heap, need to free it. + uprv_free(fullName); ++ if (baseName == fullName) { ++ baseName = newFullName; // baseName should not point to freed memory. ++ } + } + fullName = newFullName; + status = U_ZERO_ERROR;