| OLD | NEW |
| (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 |
| OLD | NEW |