• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 The Chromium Authors
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 "net/proxy_resolution/proxy_bypass_rules.h"
9 
10 // Entry point for LibFuzzer.
LLVMFuzzerTestOneInput(const uint8_t * data,size_t size)11 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
12   // Don't waste time parsing if the input is too large
13   // (https://crbug.com/813619). According to
14   // //testing/libfuzzer/efficient_fuzzer.md setting max_len in the build
15   // target is insufficient since AFL doesn't respect it.
16   if (size > 512)
17     return 0;
18 
19   net::ProxyBypassRules rules;
20   std::string input(data, data + size);
21   rules.ParseFromString(input);
22 
23   return 0;
24 }
25