File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 1313#include < cstdint>
1414#include < exception>
1515#include < memory>
16+ #include < string>
1617#include < unistd.h>
1718#include < vector>
1819
@@ -37,6 +38,14 @@ void initialize()
3738 // Terminate immediately if a fuzzing harness ever tries to create a TCP socket.
3839 CreateSock = [](const CService&) -> std::unique_ptr<Sock> { std::terminate (); };
3940
41+ // Terminate immediately if a fuzzing harness ever tries to perform a DNS lookup.
42+ g_dns_lookup = [](const std::string& name, bool allow_lookup) {
43+ if (allow_lookup) {
44+ std::terminate ();
45+ }
46+ return WrappedGetAddrInfo (name, false );
47+ };
48+
4049 bool should_abort{false };
4150 if (std::getenv (" PRINT_ALL_FUZZ_TARGETS_AND_ABORT" )) {
4251 for (const auto & t : FuzzTargets ()) {
You can’t perform that action at this time.
0 commit comments