We're updating the issue view to help you get more done. 

OOM not handled in calendar.cpp in some places (ICU4C)

Description

There's a few places where new is not checked in calendar.cpp, leading to crashes if it returns nullptr on failure.
Link to code:
https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/calendar.cpp#L380

1 2 3 4 5 case CALTYPE_ISO8601: cal = new GregorianCalendar(loc, status); cal->setFirstDayOfWeek(UCAL_MONDAY); cal->setMinimalDaysInFirstWeek(4); break;

If new fails, then cal is nullptr and undefined behavior (crash) occurs on line 382.

(We could also use LocalPointer here to help with clean-up as well.)

Environment

Status

Assignee

Jeff Genovy

Reporter

Jeff Genovy

Labels

Components

Fix versions

Priority

medium