python/hypothesis: update to 6.121.0
[oi-userland.git] / components / library / icu-75 / patches / 101-source-common-uts46.cpp.patch
blobccd05de2a98c0c277ff67e235e8c0369e873f5b5
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 @@ -924,7 +924,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.