xref: /aosp_15_r20/external/cronet/testing/libfuzzer/fuzzers/empty_fuzzer.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2015 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 // Empty fuzzer that doesn't do anything. Used as test and documentation.
6 
7 #include <stddef.h>
8 #include <stdint.h>
9 
10 // Environment is optional.
11 struct Environment {
EnvironmentEnvironment12   Environment() {
13     // Initialize your environment.
14   }
15 };
16 
17 // Fuzzer entry point.
LLVMFuzzerTestOneInput(const uint8_t * data,size_t size)18 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
19   // Initialize environment once.
20   static Environment env;
21   // Run your code on data.
22   return 0;
23 }
24