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 13
13
#include < cstdint>
14
14
#include < exception>
15
15
#include < memory>
16
+ #include < string>
16
17
#include < unistd.h>
17
18
#include < vector>
18
19
@@ -37,6 +38,14 @@ void initialize()
37
38
// Terminate immediately if a fuzzing harness ever tries to create a TCP socket.
38
39
CreateSock = [](const CService&) -> std::unique_ptr<Sock> { std::terminate (); };
39
40
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
+
40
49
bool should_abort{false };
41
50
if (std::getenv (" PRINT_ALL_FUZZ_TARGETS_AND_ABORT" )) {
42
51
for (const auto & t : FuzzTargets ()) {
You can’t perform that action at this time.
0 commit comments