]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/fuzzer/uloc_open_keywords_fuzzer.cc
1 // © 2019 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
6 #include "locale_util.h"
7 #include "unicode/uenum.h"
8 #include "unicode/uloc.h"
10 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data
, size_t size
) {
11 const std::string input
= MakeZeroTerminatedInput(data
, size
);
13 UErrorCode status
= U_ZERO_ERROR
;
14 UEnumeration
* enumeration
= uloc_openKeywords(input
.c_str(), &status
);
16 // Have to clean up. Call works even for nullptr enumeration.
17 uenum_close(enumeration
);