aboutsummaryrefslogtreecommitdiffstats
path: root/main/icu
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2016-12-26 21:53:06 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2016-12-26 21:53:28 +0100
commit40d6cc47af907fd5002149498c93d91f6a143c63 (patch)
treed502964cd94297ef704ad9106d539c1efce537d1 /main/icu
parent6d514467a0bfbb33c9b68424855c624f2068191b (diff)
downloadaports-40d6cc47af907fd5002149498c93d91f6a143c63.tar.bz2
aports-40d6cc47af907fd5002149498c93d91f6a143c63.tar.xz
main/icu: fix segfault in firefox and remove old patches
Diffstat (limited to 'main/icu')
-rw-r--r--main/icu/APKBUILD12
-rw-r--r--main/icu/CVE-2016-6293.patch232
-rw-r--r--main/icu/icu-58.1-iterator-reset.patch124
-rw-r--r--main/icu/musl-fixes.patch11
4 files changed, 132 insertions, 247 deletions
diff --git a/main/icu/APKBUILD b/main/icu/APKBUILD
index 7f5ac2de76..fc891b2982 100644
--- a/main/icu/APKBUILD
+++ b/main/icu/APKBUILD
@@ -6,7 +6,7 @@ pkgver=58.2
# convert x.y.z to x_y_z
_ver=${pkgver//./_}
-pkgrel=0
+pkgrel=1
pkgdesc="International Components for Unicode library"
url="http://www.icu-project.org/"
arch="all"
@@ -16,6 +16,7 @@ depends=
makedepends=
source="http://download.icu-project.org/files/icu4c/${pkgver}/${pkgname}4c-$_ver-src.tgz
icu-timezone.patch
+ icu-58.1-iterator-reset.patch
"
# secfixes:
@@ -82,8 +83,11 @@ libs() {
}
md5sums="fac212b32b7ec7ab007a12dff1f3aea1 icu4c-58_2-src.tgz
-2c81d9c9a6ea0af5b7391e001f37a5e0 icu-timezone.patch"
+2c81d9c9a6ea0af5b7391e001f37a5e0 icu-timezone.patch
+7119b3fc32f4785588b2dc55a62ba85f icu-58.1-iterator-reset.patch"
sha256sums="2b0a4410153a9b20de0e20c7d8b66049a72aef244b53683d0d7521371683da0c icu4c-58_2-src.tgz
-1c3c432228ee254af7adc995d65b65a4c9dac3b868fe1e49fe588a0ffa55a158 icu-timezone.patch"
+1c3c432228ee254af7adc995d65b65a4c9dac3b868fe1e49fe588a0ffa55a158 icu-timezone.patch
+62b593b019baf172ccccc001df1bb2a204aab4d84a5731e10449ae4260eede21 icu-58.1-iterator-reset.patch"
sha512sums="5c21af748f48b392e6c0412bd0aee92162ea931820dcbfab4ec6e0299868504b303d88f7586cc95de55c777ac0dca3a29d6c8ca0892c646ebc864c8a5b5a162a icu4c-58_2-src.tgz
-40489c36e28e160f08e045acab6c19cdb712ad3b7f87f67099deac7d579aaf13d8841cd3278a6bb0e998b5c34a378348a13fcc8bb14c9c4eb4f6adbd10d66825 icu-timezone.patch"
+40489c36e28e160f08e045acab6c19cdb712ad3b7f87f67099deac7d579aaf13d8841cd3278a6bb0e998b5c34a378348a13fcc8bb14c9c4eb4f6adbd10d66825 icu-timezone.patch
+c97986e188bc0f3daa2d3bebed309b87704797f527197fde910794499d1079ea0ce33a75124d2f9a8fd451d91a44d8d5077fc77c1cd49aee53bdbaf61a5826d1 icu-58.1-iterator-reset.patch"
diff --git a/main/icu/CVE-2016-6293.patch b/main/icu/CVE-2016-6293.patch
deleted file mode 100644
index fc4562c1d0..0000000000
--- a/main/icu/CVE-2016-6293.patch
+++ /dev/null
@@ -1,232 +0,0 @@
-Index: /icu/trunk/source/common/uloc.cpp
-===================================================================
---- source/common/uloc.cpp (revision 39108)
-+++ source/common/uloc.cpp (revision 39109)
-@@ -2249,5 +2249,5 @@
- float q;
- int32_t dummy; /* to avoid uninitialized memory copy from qsort */
-- char *locale;
-+ char locale[ULOC_FULLNAME_CAPACITY+1];
- } _acceptLangItem;
-
-@@ -2291,7 +2291,5 @@
- UErrorCode *status)
- {
-- _acceptLangItem *j;
-- _acceptLangItem smallBuffer[30];
-- char **strs;
-+ MaybeStackArray<_acceptLangItem, 4> items; // Struct for collecting items.
- char tmp[ULOC_FULLNAME_CAPACITY +1];
- int32_t n = 0;
-@@ -2303,9 +2301,5 @@
- int32_t i;
- int32_t l = (int32_t)uprv_strlen(httpAcceptLanguage);
-- int32_t jSize;
-- char *tempstr; /* Use for null pointer check */
--
-- j = smallBuffer;
-- jSize = UPRV_LENGTHOF(smallBuffer);
-+
- if(U_FAILURE(*status)) {
- return -1;
-@@ -2335,25 +2329,27 @@
- t++;
- }
-- j[n].q = (float)_uloc_strtod(t,NULL);
-+ items[n].q = (float)_uloc_strtod(t,NULL);
- } else {
- /* no semicolon - it's 1.0 */
-- j[n].q = 1.0f;
-+ items[n].q = 1.0f;
- paramEnd = itemEnd;
- }
-- j[n].dummy=0;
-+ items[n].dummy=0;
- /* eat spaces prior to semi */
- for(t=(paramEnd-1);(paramEnd>s)&&isspace(*t);t--)
- ;
-- /* Check for null pointer from uprv_strndup */
-- tempstr = uprv_strndup(s,(int32_t)((t+1)-s));
-- if (tempstr == NULL) {
-- *status = U_MEMORY_ALLOCATION_ERROR;
-- return -1;
-- }
-- j[n].locale = tempstr;
-- uloc_canonicalize(j[n].locale,tmp,UPRV_LENGTHOF(tmp),status);
-- if(strcmp(j[n].locale,tmp)) {
-- uprv_free(j[n].locale);
-- j[n].locale=uprv_strdup(tmp);
-+ int32_t slen = ((t+1)-s);
-+ if(slen > ULOC_FULLNAME_CAPACITY) {
-+ *status = U_BUFFER_OVERFLOW_ERROR;
-+ return -1; // too big
-+ }
-+ uprv_strncpy(items[n].locale, s, slen);
-+ items[n].locale[slen]=0; // terminate
-+ int32_t clen = uloc_canonicalize(items[n].locale, tmp, UPRV_LENGTHOF(tmp)-1, status);
-+ if(U_FAILURE(*status)) return -1;
-+ if((clen!=slen) || (uprv_strncmp(items[n].locale, tmp, slen))) {
-+ // canonicalization had an effect- copy back
-+ uprv_strncpy(items[n].locale, tmp, clen);
-+ items[n].locale[clen] = 0; // terminate
- }
- #if defined(ULOC_DEBUG)
-@@ -2365,42 +2361,18 @@
- s++;
- }
-- if(n>=jSize) {
-- if(j==smallBuffer) { /* overflowed the small buffer. */
-- j = static_cast<_acceptLangItem *>(uprv_malloc(sizeof(j[0])*(jSize*2)));
-- if(j!=NULL) {
-- uprv_memcpy(j,smallBuffer,sizeof(j[0])*jSize);
-- }
-+ if(n>=items.getCapacity()) { // If we need more items
-+ if(NULL == items.resize(items.getCapacity()*2, items.getCapacity())) {
-+ *status = U_MEMORY_ALLOCATION_ERROR;
-+ return -1;
-+ }
- #if defined(ULOC_DEBUG)
-- fprintf(stderr,"malloced at size %d\n", jSize);
-+ fprintf(stderr,"malloced at size %d\n", items.getCapacity());
- #endif
-- } else {
-- j = static_cast<_acceptLangItem *>(uprv_realloc(j, sizeof(j[0])*jSize*2));
--#if defined(ULOC_DEBUG)
-- fprintf(stderr,"re-alloced at size %d\n", jSize);
--#endif
-- }
-- jSize *= 2;
-- if(j==NULL) {
-- *status = U_MEMORY_ALLOCATION_ERROR;
-- return -1;
-- }
-- }
-- }
-- uprv_sortArray(j, n, sizeof(j[0]), uloc_acceptLanguageCompare, NULL, TRUE, status);
-+ }
-+ }
-+ uprv_sortArray(items.getAlias(), n, sizeof(items[0]), uloc_acceptLanguageCompare, NULL, TRUE, status);
-+ LocalArray<const char*> strs(new const char*[n], *status);
- if(U_FAILURE(*status)) {
-- if(j != smallBuffer) {
--#if defined(ULOC_DEBUG)
-- fprintf(stderr,"freeing j %p\n", j);
--#endif
-- uprv_free(j);
-- }
-- return -1;
-- }
-- strs = static_cast<char **>(uprv_malloc((size_t)(sizeof(strs[0])*n)));
-- /* Check for null pointer */
-- if (strs == NULL) {
-- uprv_free(j); /* Free to avoid memory leak */
-- *status = U_MEMORY_ALLOCATION_ERROR;
-- return -1;
-+ return -1;
- }
- for(i=0;i<n;i++) {
-@@ -2408,18 +2380,8 @@
- /*fprintf(stderr,"%d: s <%s> q <%g>\n", i, j[i].locale, j[i].q);*/
- #endif
-- strs[i]=j[i].locale;
-+ strs[i]=items[i].locale;
- }
- res = uloc_acceptLanguage(result, resultAvailable, outResult,
-- (const char**)strs, n, availableLocales, status);
-- for(i=0;i<n;i++) {
-- uprv_free(strs[i]);
-- }
-- uprv_free(strs);
-- if(j != smallBuffer) {
--#if defined(ULOC_DEBUG)
-- fprintf(stderr,"freeing j %p\n", j);
--#endif
-- uprv_free(j);
-- }
-+ strs.getAlias(), n, availableLocales, status);
- return res;
- }
-Index: /icu/trunk/source/test/cintltst/cloctst.c
-===================================================================
---- source/test/cintltst/cloctst.c (revision 39108)
-+++ source/test/cintltst/cloctst.c (revision 39109)
-@@ -2778,14 +2778,18 @@
- const char *expect; /**< The expected locale result */
- UAcceptResult res; /**< The expected error code */
-+ UErrorCode expectStatus; /**< expected status */
- } tests[] = {
-- /*0*/{ 0, NULL, "mt_MT", ULOC_ACCEPT_VALID },
-- /*1*/{ 1, NULL, "en", ULOC_ACCEPT_VALID },
-- /*2*/{ 2, NULL, "en", ULOC_ACCEPT_FALLBACK },
-- /*3*/{ 3, NULL, "", ULOC_ACCEPT_FAILED },
-- /*4*/{ 4, NULL, "es", ULOC_ACCEPT_VALID },
--
-- /*5*/{ 5, NULL, "en", ULOC_ACCEPT_VALID }, /* XF */
-- /*6*/{ 6, NULL, "ja", ULOC_ACCEPT_FALLBACK }, /* XF */
-- /*7*/{ 7, NULL, "zh", ULOC_ACCEPT_FALLBACK }, /* XF */
-+ /*0*/{ 0, NULL, "mt_MT", ULOC_ACCEPT_VALID, U_ZERO_ERROR},
-+ /*1*/{ 1, NULL, "en", ULOC_ACCEPT_VALID, U_ZERO_ERROR},
-+ /*2*/{ 2, NULL, "en", ULOC_ACCEPT_FALLBACK, U_ZERO_ERROR},
-+ /*3*/{ 3, NULL, "", ULOC_ACCEPT_FAILED, U_ZERO_ERROR},
-+ /*4*/{ 4, NULL, "es", ULOC_ACCEPT_VALID, U_ZERO_ERROR},
-+ /*5*/{ 5, NULL, "en", ULOC_ACCEPT_VALID, U_ZERO_ERROR}, /* XF */
-+ /*6*/{ 6, NULL, "ja", ULOC_ACCEPT_FALLBACK, U_ZERO_ERROR}, /* XF */
-+ /*7*/{ 7, NULL, "zh", ULOC_ACCEPT_FALLBACK, U_ZERO_ERROR}, /* XF */
-+ /*8*/{ 8, NULL, "", ULOC_ACCEPT_FAILED, U_ZERO_ERROR }, /* */
-+ /*9*/{ 9, NULL, "", ULOC_ACCEPT_FAILED, U_ZERO_ERROR }, /* */
-+ /*10*/{10, NULL, "", ULOC_ACCEPT_FAILED, U_BUFFER_OVERFLOW_ERROR }, /* */
-+ /*11*/{11, NULL, "", ULOC_ACCEPT_FAILED, U_BUFFER_OVERFLOW_ERROR }, /* */
- };
- const int32_t numTests = UPRV_LENGTHOF(tests);
-@@ -2803,8 +2807,23 @@
- "xxx-yyy;q=.01, xxx-yyy;q=.01, xxx-yyy;q=.01, xx-yy;q=.1, "
- "es",
--
- /*5*/ "zh-xx;q=0.9, en;q=0.6",
- /*6*/ "ja-JA",
- /*7*/ "zh-xx;q=0.9",
-+ /*08*/ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
-+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
-+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
-+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", // 156
-+ /*09*/ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
-+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
-+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
-+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB", // 157 (this hits U_STRING_NOT_TERMINATED_WARNING )
-+ /*10*/ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
-+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
-+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
-+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABC", // 158
-+ /*11*/ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
-+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
-+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
-+ "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", // 163 bytes
- };
-
-@@ -2821,5 +2840,9 @@
- uenum_close(available);
- log_verbose(" got %s, %s [%s]\n", tmp[0]?tmp:"(EMPTY)", acceptResult(outResult), u_errorName(status));
-- if(outResult != tests[i].res) {
-+ if(status != tests[i].expectStatus) {
-+ log_err_status(status, "FAIL: expected status %s but got %s\n", u_errorName(tests[i].expectStatus), u_errorName(status));
-+ } else if(U_SUCCESS(tests[i].expectStatus)) {
-+ /* don't check content if expected failure */
-+ if(outResult != tests[i].res) {
- log_err_status(status, "FAIL: #%d: expected outResult of %s but got %s\n", i,
- acceptResult( tests[i].res),
-@@ -2827,9 +2850,10 @@
- log_info("test #%d: http[%s], ICU[%s], expect %s, %s\n",
- i, http[tests[i].httpSet], tests[i].icuSet, tests[i].expect,acceptResult(tests[i].res));
-- }
-- if((outResult>0)&&uprv_strcmp(tmp, tests[i].expect)) {
-- log_err_status(status, "FAIL: #%d: expected %s but got %s\n", i, tests[i].expect, tmp);
-- log_info("test #%d: http[%s], ICU[%s], expect %s, %s\n",
-- i, http[tests[i].httpSet], tests[i].icuSet, tests[i].expect, acceptResult(tests[i].res));
-+ }
-+ if((outResult>0)&&uprv_strcmp(tmp, tests[i].expect)) {
-+ log_err_status(status, "FAIL: #%d: expected %s but got %s\n", i, tests[i].expect, tmp);
-+ log_info("test #%d: http[%s], ICU[%s], expect %s, %s\n",
-+ i, http[tests[i].httpSet], tests[i].icuSet, tests[i].expect, acceptResult(tests[i].res));
-+ }
- }
- }
diff --git a/main/icu/icu-58.1-iterator-reset.patch b/main/icu/icu-58.1-iterator-reset.patch
new file mode 100644
index 0000000000..24c7fa96de
--- /dev/null
+++ b/main/icu/icu-58.1-iterator-reset.patch
@@ -0,0 +1,124 @@
+Index: /icu/trunk/source/common/ulist.c
+===================================================================
+--- source/common/ulist.c (revision 39483)
++++ source/common/ulist.c (revision 39484)
+@@ -30,5 +30,4 @@
+
+ int32_t size;
+- int32_t currentIndex;
+ };
+
+@@ -52,5 +51,4 @@
+ newList->tail = NULL;
+ newList->size = 0;
+- newList->currentIndex = -1;
+
+ return newList;
+@@ -81,6 +79,7 @@
+ p->next->previous = p->previous;
+ }
+- list->curr = NULL;
+- list->currentIndex = 0;
++ if (p == list->curr) {
++ list->curr = p->next;
++ }
+ --list->size;
+ if (p->forceDelete) {
+@@ -151,5 +150,4 @@
+ list->head->previous = newItem;
+ list->head = newItem;
+- list->currentIndex++;
+ }
+
+@@ -194,5 +192,4 @@
+ curr = list->curr;
+ list->curr = curr->next;
+- list->currentIndex++;
+
+ return curr->data;
+@@ -210,5 +207,4 @@
+ if (list != NULL) {
+ list->curr = list->head;
+- list->currentIndex = 0;
+ }
+ }
+@@ -273,3 +269,2 @@
+ return (UList *)(en->context);
+ }
+-
+Index: /icu/trunk/source/i18n/ucol_res.cpp
+===================================================================
+--- source/i18n/ucol_res.cpp (revision 39483)
++++ source/i18n/ucol_res.cpp (revision 39484)
+@@ -681,4 +681,5 @@
+ }
+ memcpy(en, &defaultKeywordValues, sizeof(UEnumeration));
++ ulist_resetList(sink.values); // Initialize the iterator.
+ en->context = sink.values;
+ sink.values = NULL; // Avoid deletion in the sink destructor.
+Index: /icu/trunk/source/test/intltest/apicoll.cpp
+===================================================================
+--- source/test/intltest/apicoll.cpp (revision 39483)
++++ source/test/intltest/apicoll.cpp (revision 39484)
+@@ -82,14 +82,7 @@
+ col = Collator::createInstance(Locale::getEnglish(), success);
+ if (U_FAILURE(success)){
+- errcheckln(success, "Default Collator creation failed. - %s", u_errorName(success));
+- return;
+- }
+-
+- StringEnumeration* kwEnum = col->getKeywordValuesForLocale("", Locale::getEnglish(),true,success);
+- if (U_FAILURE(success)){
+- errcheckln(success, "Get Keyword Values for Locale failed. - %s", u_errorName(success));
+- return;
+- }
+- delete kwEnum;
++ errcheckln(success, "English Collator creation failed. - %s", u_errorName(success));
++ return;
++ }
+
+ col->getVersion(versionArray);
+@@ -230,4 +223,27 @@
+ delete aFrCol;
+ delete junk;
++}
++
++void CollationAPITest::TestKeywordValues() {
++ IcuTestErrorCode errorCode(*this, "TestKeywordValues");
++ LocalPointer<Collator> col(Collator::createInstance(Locale::getEnglish(), errorCode));
++ if (errorCode.logIfFailureAndReset("English Collator creation failed")) {
++ return;
++ }
++
++ LocalPointer<StringEnumeration> kwEnum(
++ col->getKeywordValuesForLocale("collation", Locale::getEnglish(), TRUE, errorCode));
++ if (errorCode.logIfFailureAndReset("Get Keyword Values for English Collator failed")) {
++ return;
++ }
++ assertTrue("expect at least one collation tailoring for English", kwEnum->count(errorCode) > 0);
++ const char *kw;
++ UBool hasStandard = FALSE;
++ while ((kw = kwEnum->next(NULL, errorCode)) != NULL) {
++ if (strcmp(kw, "standard") == 0) {
++ hasStandard = TRUE;
++ }
++ }
++ assertTrue("expect at least the 'standard' collation tailoring for English", hasStandard);
+ }
+
+@@ -2467,4 +2483,5 @@
+ TESTCASE_AUTO_BEGIN;
+ TESTCASE_AUTO(TestProperty);
++ TESTCASE_AUTO(TestKeywordValues);
+ TESTCASE_AUTO(TestOperators);
+ TESTCASE_AUTO(TestDuplicate);
+Index: /icu/trunk/source/test/intltest/apicoll.h
+===================================================================
+--- source/test/intltest/apicoll.h (revision 39483)
++++ source/test/intltest/apicoll.h (revision 39484)
+@@ -36,4 +36,5 @@
+ */
+ void TestProperty(/* char* par */);
++ void TestKeywordValues();
+
+ /**
diff --git a/main/icu/musl-fixes.patch b/main/icu/musl-fixes.patch
deleted file mode 100644
index 3418230862..0000000000
--- a/main/icu/musl-fixes.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/i18n/digitlst.cpp
-+++ b/i18n/digitlst.cpp
-@@ -61,7 +61,7 @@
- #endif
-
- #if U_USE_STRTOD_L && !U_PLATFORM_USES_ONLY_WIN32_API
--# if U_PLATFORM == U_PF_CYGWIN
-+# if U_PLATFORM == U_PF_CYGWIN || U_PLATFORM == U_PF_LINUX
- # include <locale.h>
- # else
- # include <xlocale.h>