Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Side by Side Diff: net/base/registry_controlled_domains/get_domain_and_registry_fuzzer.cc

Issue 1735043004: Add fuzz testers to //net for some functions with simple parsing APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/base/parse_ip_pattern_fuzzer.cc ('k') | net/base/sniff_mime_type_fuzzer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <stddef.h>
6 #include <stdint.h>
7
8 #include "base/at_exit.h"
9 #include "base/i18n/icu_util.h"
10 #include "base/strings/string_piece.h"
11 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
12 #include "url/gurl.h"
13
14 // Initialize ICU.
15 struct InitICU {
16 InitICU() { CHECK(base::i18n::InitializeICU()); }
17 base::AtExitManager at_exit_manager;
18 };
19
20 InitICU* init_icu = new InitICU();
21
22 // Entry point for LibFuzzer.
23 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
24 // Call GetDomainAndRegistry() twice - once with each filter type to ensure
25 // both code paths are exercised.
26 net::registry_controlled_domains::GetDomainAndRegistry(
27 base::StringPiece(reinterpret_cast<const char*>(data), size),
28 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
29
30 net::registry_controlled_domains::GetDomainAndRegistry(
31 base::StringPiece(reinterpret_cast<const char*>(data), size),
32 net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
33
34 return 0;
35 }
OLDNEW
« no previous file with comments | « net/base/parse_ip_pattern_fuzzer.cc ('k') | net/base/sniff_mime_type_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698