openjdk-23: use OpenJDK 23 as the boot JDK
[oi-userland.git] / components / library / icu-72 / patches / 092-source-i18n-zonemeta.cpp.patch
blobb2e3a5fafcc000f6e9cef66d7acd3a9f67ad1e7d
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 @@ -1295,6 +1295,10 @@
10 do { // dummy do-while
12 tzids = TimeZone::createTimeZoneIDEnumeration(ZONE_SET, NULL, NULL, status);
13 + if (tzids == NULL) {
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 @@ -456,12 +456,14 @@
23 u_UCharsToChars(region, regionBuf, 2);
25 StringEnumeration *ids = TimeZone::createTimeZoneIDEnumeration(UCAL_ZONE_TYPE_CANONICAL_LOCATION, regionBuf, NULL, 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 - }
31 - delete ids;
32 + if (ids != NULL) {
33 + int32_t idsLen = ids->count(status);
34 + if (U_SUCCESS(status) && idsLen == 1) {
35 + // only the single zone is available for the region
36 + singleZone = true;
37 + }
38 + delete ids;
39 + }
41 // Cache the result
42 umtx_lock(&gZoneMetaLock);