Implement fuzzed_dns_lookup_function
as a lambda.
As wisely suggested by MarcoFalke in #19415 (review). Thanks! :)
Implement fuzzed_dns_lookup_function
as a lambda.
As wisely suggested by MarcoFalke in #19415 (review). Thanks! :)
32 const std::string name = fuzzed_data_provider.ConsumeRandomLengthString(512);
33 const unsigned int max_results = fuzzed_data_provider.ConsumeIntegral<unsigned int>();
34 const bool allow_lookup = fuzzed_data_provider.ConsumeBool();
35 const int default_port = fuzzed_data_provider.ConsumeIntegral<int>();
36+
37+ auto fuzzed_dns_lookup_function = [&](const std::string&, bool) {
FUZZ_TARGET()
be added. It is ok since here we have just one FUZZ_TARGET()
and if ever another one is added and reuse needed, then it could be done in another way.
I think (and hope) that the netbase_dns_lookup
fuzzing harness should cover all our low-level DNS fuzzing needs, so I think the probability that we’ll need to call fuzzed_dns_lookup_function
from another FUZZ_TARGET
in the future is relatively low.
In other words: let’s cross that fuzzing bridge when we come to it :)