Commit 6032fd24 authored by mmoroz's avatar mmoroz Committed by Commit bot

[libfuzzer] fuzzer for uregex_open from third_party/icu implemented

R=aizatsky@chromium.org, inferno@chromium.org, kcc@chromium.org, krasin@chromium.org
BUG=539572

Review URL: https://codereview.chromium.org/1636823002

Cr-Commit-Position: refs/heads/master@{#371375}
parent 952b7129
......@@ -303,3 +303,12 @@ fuzzer_test("libpng_read_fuzzer") {
"//third_party/libpng",
]
}
fuzzer_test("icu_uregex_open_fuzzer") {
sources = [
"icu_uregex_open_fuzzer.cc",
]
deps = [
"//third_party/icu",
]
}
// Copyright (c) 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stdint.h>
#include "third_party/icu/source/i18n/unicode/regex.h"
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data, size_t size) {
UParseError pe = { 0 };
UErrorCode status = U_ZERO_ERROR;
URegularExpression* re = uregex_open(reinterpret_cast<const UChar*>(data),
size / sizeof(UChar),
0, &pe, &status);
if (re)
uregex_close(re);
return 0;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment