# # Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. # getBuffer handling is tracked upstream as https://unicode-org.atlassian.net/browse/ICU-12378 --- icu/source/tools/genrb/reslist.cpp.orig +++ icu/source/tools/genrb/reslist.cpp @@ -1507,8 +1507,16 @@ const StringResource *left = *((const StringResource **)l); const StringResource *right = *((const StringResource **)r); const UChar *lStart = left->getBuffer(); + if ( lStart == NULL ) { + fprintf(stderr, "Could not allocate memory!!"); + exit(U_MEMORY_ALLOCATION_ERROR); + } const UChar *lLimit = lStart + left->length(); const UChar *rStart = right->getBuffer(); + if ( rStart == NULL ) { + fprintf(stderr, "Could not allocate memory!!"); + exit(U_MEMORY_ALLOCATION_ERROR); + } const UChar *rLimit = rStart + right->length(); int32_t diff; /* compare keys in reverse character order */