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
10 do { // dummy do-while
12 tzids = TimeZone::createTimeZoneIDEnumeration(ZONE_SET, NULL, NULL, status);
13 + if (tzids == NULL) {
14 + status = U_MEMORY_ALLOCATION_ERROR;
17 rows = tzids->count(status);
18 if (U_FAILURE(status)) {
20 --- icu/source/i18n/zonemeta.cpp.orig
21 +++ icu/source/i18n/zonemeta.cpp
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
33 + int32_t idsLen = ids->count(status);
34 + if (U_SUCCESS(status) && idsLen == 1) {
35 + // only the single zone is available for the region
42 umtx_lock(&gZoneMetaLock);