Commit 3cc4fe8d authored by aizatsky's avatar aizatsky Committed by Commit bot

//base:json reader fuzzer

BUG=

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

Cr-Commit-Position: refs/heads/master@{#361184}
parent 1de8a82b
...@@ -195,3 +195,13 @@ test("v8_json_parser_fuzzer") { ...@@ -195,3 +195,13 @@ test("v8_json_parser_fuzzer") {
"$root_out_dir/snapshot_blob.bin", "$root_out_dir/snapshot_blob.bin",
] ]
} }
test("base_json_reader_fuzzer") {
sources = [
"base_json_reader_fuzzer.cc",
]
deps = [
"//base",
"//testing/libfuzzer:libfuzzer_main",
]
}
// Copyright (c) 2015 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 <string>
#include "base/json/json_reader.h"
#include "base/values.h"
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data,
unsigned long size) {
base::JSONReader reader;
reader.Read(std::string(reinterpret_cast<const char*>(data), size));
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