#
# 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 char16_t *lStart = left->getBuffer();
+    if (lStart == nullptr) {
+        fprintf(stderr, "Could not allocate memory!!");
+        exit(U_MEMORY_ALLOCATION_ERROR);
+    }
     const char16_t *lLimit = lStart + left->length();
     const char16_t *rStart = right->getBuffer();
+    if (rStart == nullptr) {
+        fprintf(stderr, "Could not allocate memory!!");
+        exit(U_MEMORY_ALLOCATION_ERROR);
+    }
     const char16_t *rLimit = rStart + right->length();
     int32_t diff;
     /* compare keys in reverse character order */