]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/test/fuzzer/locale_util.cpp
ICU-66108.tar.gz
[apple/icu.git] / icuSources / test / fuzzer / locale_util.cpp
diff --git a/icuSources/test/fuzzer/locale_util.cpp b/icuSources/test/fuzzer/locale_util.cpp
new file mode 100644 (file)
index 0000000..d39aeee
--- /dev/null
@@ -0,0 +1,12 @@
+// © 2019 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
+
+// Helper method for ICU locale fuzzer.
+
+#include "locale_util.h"
+
+#include <string>
+
+std::string MakeZeroTerminatedInput(const uint8_t *data, int32_t size) {
+  return size == 0 ? "" : std::string(reinterpret_cast<const char *>(data), size);
+}