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) {
This is impossible to reuse if another 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 :)
YAGNI (you ain't gonna need it)
ACK 7c8c140ecc95ab2ac90e20951416886c9ac5fa93
cr ACK 7c8c140ecc95ab2ac90e20951416886c9ac5fa93
Tested ACK 7c8c140ecc95ab2ac90e20951416886c9ac5fa93
3rd time today my ACK missed a merge by a few seconds...there are days like that :D