ICU-11872 fix invalid memory read

X-SVN-Rev: 38467
This commit is contained in:
kazède king 2016-03-02 23:49:30 +00:00
parent 4a45deb1ac
commit d845084966

View file

@ -457,13 +457,13 @@ struct AllowedHourFormatsSink : public ResourceTableSink {
if (uprv_strcmp(key, "allowed") == 0) {
outer.allowedFormats = new int32_t[2];
outer.allowedFormatsLength = 1;
if (outer.allowedFormats == NULL) {
status = U_MEMORY_ALLOCATION_ERROR;
return;
}
outer.allowedFormats[0] = outer.getHourFormatFromUnicodeString(
value.getUnicodeString(status));
outer.allowedFormats[1] = ALLOWED_HOUR_FORMAT_UNKNOWN;
}
}