Commit d4161ae3 authored by Olle Liljenzin's avatar Olle Liljenzin Committed by Commit Bot

Fuzz LookupStringInFixedSet

Adds a dedicated fuzzer for LookupStringInFixedSet() as the function is
no longer tested by the GetDomainAndRegistry fuzzer.

The fuzzer is using a forward generated DAFSA based on the public suffix
list and reuses the dictionary from the GetDomainAndRegistry fuzzer.

BUG=1048702

Change-Id: If123985c60efab57faddaa934e6674042dd4d07a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2050498Reviewed-by: default avatarRyan Sleevi <rsleevi@chromium.org>
Commit-Queue: Olle Liljenzin <ollel@opera.com>
Cr-Commit-Position: refs/heads/master@{#740799}
parent 41e111d0
......@@ -5009,6 +5009,17 @@ fuzzer_test("net_get_domain_and_registry_fuzzer") {
dict = "data/fuzzer_dictionaries/net_get_domain_and_registry_fuzzer.dict"
}
fuzzer_test("net_lookup_string_in_fixed_set_fuzzer") {
sources = [ "base/lookup_string_in_fixed_set_fuzzer.cc" ]
deps = [
":net_fuzzer_test_support",
"//base",
"//net",
"//net/base/registry_controlled_domains:lookup_strings_test_sets",
]
dict = "data/fuzzer_dictionaries/net_get_domain_and_registry_fuzzer.dict"
}
fuzzer_test("net_cert_ct_decode_signed_certificate_timestamp_fuzzer") {
sources = [ "cert/decode_signed_certificate_timestamp_fuzzer.cc" ]
deps = [
......
// Copyright 2020 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 <stddef.h>
#include <stdint.h>
#include "net/base/lookup_string_in_fixed_set.h"
namespace {
#include "net/base/registry_controlled_domains/effective_tld_names-inc.cc"
} // namespace
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
net::LookupStringInFixedSet(kDafsa, sizeof(kDafsa),
reinterpret_cast<const char*>(data), size);
return 0;
}
......@@ -25,6 +25,7 @@ action_foreach("registry_controlled_domains") {
action_foreach("lookup_strings_test_sets") {
script = "//net/tools/dafsa/make_dafsa.py"
sources = [
"effective_tld_names.gperf",
"effective_tld_names_unittest1.gperf",
"effective_tld_names_unittest2.gperf",
"effective_tld_names_unittest3.gperf",
......
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