]>
git.saurik.com Git - apple/icu.git/blob - icuSources/test/fuzzer/uloc_get_name_fuzzer.cpp
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/uloc.h"
9 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data
, size_t size
) {
11 char name
[ULOC_FULLNAME_CAPACITY
];
12 int32_t name_capacity
= ULOC_FULLNAME_CAPACITY
;
14 const std::string input
= MakeZeroTerminatedInput(data
, size
);
16 UErrorCode status
= U_ZERO_ERROR
;
17 uloc_getName(input
.c_str(), name
, name_capacity
, &status
);