diff --git a/fuzz/fuzz_http_endpoint.cc b/fuzz/fuzz_http_endpoint.cc index d9ef1e0834..ddddd77f8d 100644 --- a/fuzz/fuzz_http_endpoint.cc +++ b/fuzz/fuzz_http_endpoint.cc @@ -164,8 +164,9 @@ LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) { } } listener.stop(); - io_service->poll(); client.stop(); + run_io_service_timer.cancel(); + io_service->poll(); MultiThreadingMgr::instance().setMode(false); return 0; diff --git a/fuzz/main.cc b/fuzz/main.cc index b08abaf938..c3d8f2606c 100644 --- a/fuzz/main.cc +++ b/fuzz/main.cc @@ -6,14 +6,17 @@ #include +#include #include #include #include #include +#include #include #include #include +#include #include #include @@ -22,6 +25,7 @@ #include #include +using namespace isc; using namespace isc::util::file; using namespace std; @@ -52,7 +56,11 @@ main(int, char* argv[]) { list files; struct dirent *dp; - DIR *dfd(opendir(p.str().c_str())); + DIR *dfd(opendir(directory.c_str())); + if (!dfd) { + isc_throw(Unexpected, "opendir failed " << directory << ": " << strerror(errno)); + } + std::unique_ptr defer(dfd, [](DIR* d) { closedir(d); }); while ((dp = readdir(dfd)) != nullptr) { string file(dp->d_name); if (file == "." || file == "..") {