ruby-32: re-add architecure independent manifest support, remove unnecassary GNU_CPU...
[oi-userland.git] / components / library / icu-74 / patches / 092-source-i18n-zonemeta.cpp.patch
blob620406dfc581e9f14e7dd154e6e4323593d00844
2 # Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
4 Add NULL checks for TimeZone::createTimeZoneIDEnumeration calls
5 https://unicode-org.atlassian.net/browse/ICU-12377
7 --- icu/source/i18n/dtfmtsym.cpp.orig
8 +++ icu/source/i18n/dtfmtsym.cpp
9 @@ -1303,6 +1303,10 @@
10 do { // dummy do-while
12 tzids = TimeZone::createTimeZoneIDEnumeration(ZONE_SET, nullptr, nullptr, status);
13 + if (tzids == nullptr) {
14 + status = U_MEMORY_ALLOCATION_ERROR;
15 + break;
16 + }
17 rows = tzids->count(status);
18 if (U_FAILURE(status)) {
19 break;
20 --- icu/source/i18n/zonemeta.cpp.orig
21 +++ icu/source/i18n/zonemeta.cpp
22 @@ -486,12 +486,14 @@
23 u_UCharsToChars(region, regionBuf, 2);
25 StringEnumeration *ids = TimeZone::createTimeZoneIDEnumeration(UCAL_ZONE_TYPE_CANONICAL_LOCATION, regionBuf, nullptr, status);
26 - int32_t idsLen = ids->count(status);
27 - if (U_SUCCESS(status) && idsLen == 1) {
28 - // only the single zone is available for the region
29 - singleZone = true;
30 + if (ids != nullptr) {
31 + int32_t idsLen = ids->count(status);
32 + if (U_SUCCESS(status) && idsLen == 1) {
33 + // only the single zone is available for the region
34 + singleZone = true;
35 + }
36 + delete ids;
38 - delete ids;
40 // Cache the result
41 umtx_lock(&gZoneMetaLock);