/src/curl_fuzzer/fuzzer_entrypoints/curl_fuzzer_proto.cc
Line | Count | Source |
1 | | /* |
2 | | * Copyright (C) Max Dymond, <cmeister2@gmail.com>, et al. |
3 | | * |
4 | | * SPDX-License-Identifier: curl |
5 | | */ |
6 | | |
7 | | #include "proto_fuzzer/fuzzer_main.h" |
8 | | |
9 | | namespace { |
10 | | |
11 | | // Bind this source's visible target identity once so mutation, crossover, and |
12 | | // execution cannot drift onto different policies as the shared runner evolves. |
13 | | using Fuzzer = proto_fuzzer::ProtoFuzzerEntrypoint< |
14 | | proto_fuzzer::TargetProfile::kCompatibility>; |
15 | | |
16 | | } // namespace |
17 | | |
18 | | // Keep all three libFuzzer ABI hooks in the same-named source. Besides making |
19 | | // the selected profile explicit, this lets Fuzz Introspector attribute the |
20 | | // historical mixed lane independently while the implementation remains shared. |
21 | | extern "C" std::size_t LLVMFuzzerCustomMutator(std::uint8_t *data, |
22 | | std::size_t size, |
23 | | std::size_t max_size, |
24 | 0 | unsigned int seed) { |
25 | 0 | return Fuzzer::CustomMutator(data, size, max_size, seed); |
26 | 0 | } |
27 | | |
28 | | extern "C" std::size_t |
29 | | LLVMFuzzerCustomCrossOver(const std::uint8_t *data1, std::size_t size1, |
30 | | const std::uint8_t *data2, std::size_t size2, |
31 | | std::uint8_t *out, std::size_t max_out_size, |
32 | 0 | unsigned int seed) { |
33 | 0 | return Fuzzer::CustomCrossOver(data1, size1, data2, size2, out, max_out_size, |
34 | 0 | seed); |
35 | 0 | } |
36 | | |
37 | | extern "C" int LLVMFuzzerTestOneInput(const std::uint8_t *data, |
38 | 264k | std::size_t size) { |
39 | 264k | return Fuzzer::TestOneInput(data, size); |
40 | 264k | } |