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

Side by Side Diff: components/policy/core/common/preg_parser_fuzzer.cc

Issue 2791193005: Add fuzzer test for preg_parser (Closed)
Patch Set: Compile preg parser on Linux Created 3 years, 8 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
OLDNEW
(Empty)
1 // Copyright 2017 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/strings/utf_string_conversions.h>
9 #include "base/strings/string16.h"
10
11 #include "components/policy/core/common/policy_load_status.h"
12 #include "components/policy/core/common/preg_parser.h"
13 #include "components/policy/core/common/registry_dict.h"
14
15 namespace {
16
17 const char kRegistryChromePolicyKey[] = "SOFTWARE\\Policies\\Chromium";
18
19 } // namespace
20
21 namespace policy {
22 namespace preg_parser {
23
24 // Disable logging.
25 struct Environment {
26 Environment() : root(base::ASCIIToUTF16(kRegistryChromePolicyKey)) {
27 logging::SetMinLogLevel(logging::LOG_FATAL);
28 }
29
30 const base::string16 root;
31 };
32
33 Environment* env = new Environment();
34
35 // Entry point for LibFuzzer.
36 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
37 RegistryDict dict;
38 PolicyLoadStatus status;
39 ReadDataInternal(data, size, env->root, &dict, &status, "data");
40 return 0;
41 }
42
43 } // namespace preg_parser
44 } // namespace policy
OLDNEW
« components/policy/core/common/preg_parser.cc ('K') | « components/policy/core/common/preg_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698