mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-29 04:57:52 +00:00
[#3605] Razvan's fix for ASAN warnings in fuzzing
This commit is contained in:
parent
a96168e762
commit
a4f4e30b3d
@ -164,8 +164,9 @@ LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
listener.stop();
|
listener.stop();
|
||||||
io_service->poll();
|
|
||||||
client.stop();
|
client.stop();
|
||||||
|
run_io_service_timer.cancel();
|
||||||
|
io_service->poll();
|
||||||
MultiThreadingMgr::instance().setMode(false);
|
MultiThreadingMgr::instance().setMode(false);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
10
fuzz/main.cc
10
fuzz/main.cc
@ -6,14 +6,17 @@
|
|||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
#include <exceptions/exceptions.h>
|
||||||
#include <util/filesystem.h>
|
#include <util/filesystem.h>
|
||||||
#include <fuzz.h>
|
#include <fuzz.h>
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <cstring>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <memory>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -22,6 +25,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
using namespace isc;
|
||||||
using namespace isc::util::file;
|
using namespace isc::util::file;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -52,7 +56,11 @@ main(int, char* argv[]) {
|
|||||||
list<string> files;
|
list<string> files;
|
||||||
|
|
||||||
struct dirent *dp;
|
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<DIR, void(*)(DIR*)> defer(dfd, [](DIR* d) { closedir(d); });
|
||||||
while ((dp = readdir(dfd)) != nullptr) {
|
while ((dp = readdir(dfd)) != nullptr) {
|
||||||
string file(dp->d_name);
|
string file(dp->d_name);
|
||||||
if (file == "." || file == "..") {
|
if (file == "." || file == "..") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user