ruby-32: re-add architecure independent manifest support, remove unnecassary GNU_CPU...
[oi-userland.git] / components / library / icu-74 / patches / 101-source-common-uts46.cpp.patch
blobf26c11582c28247ce6d7f1aff563db1dcf39968e
2 # Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
4 Add NULL checks to getBuffer calls
5 https://unicode-org.atlassian.net/browse/ICU-12378
7 --- icu/source/common/uts46.cpp.orig
8 +++ icu/source/common/uts46.cpp
9 @@ -923,7 +923,12 @@
10 UBool disallowNonLDHDot=(options&UIDNA_USE_STD3_RULES)!=0;
11 UBool isASCII=true;
12 UBool onlyLDH=true;
13 - const char16_t *label=dest.getBuffer()+labelStart;
14 + const char16_t *l=dest.getBuffer();
15 + if(l==nullptr) {
16 + info.labelErrors|=UIDNA_ERROR_LABEL_TOO_LONG;
17 + return 0;
18 + }
19 + const char16_t *label=l+labelStart;
20 const char16_t *limit=label+labelLength;
21 // Start after the initial "xn--".
22 // Ok to cast away const because we own the UnicodeString.