From 5bbb7538bb861899aca505333a4f2fddad799972 Mon Sep 17 00:00:00 2001 From: David Drysdale Date: Tue, 29 Mar 2016 10:54:11 +0100 Subject: [PATCH] test: Update fuzzing function prototype libFuzzer changed expected return type from void to int in LLVM 3.8. --- test/ares-fuzz.cc | 4 ++-- test/ares-test-fuzz.cc | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/test/ares-fuzz.cc b/test/ares-fuzz.cc index 4680b727..936dd46e 100644 --- a/test/ares-fuzz.cc +++ b/test/ares-fuzz.cc @@ -5,8 +5,8 @@ #include -extern "C" void LLVMFuzzerTestOneInput(const unsigned char *data, - unsigned long size); +extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, + unsigned long size); int main() { std::vector input; while (true) { diff --git a/test/ares-test-fuzz.cc b/test/ares-test-fuzz.cc index 49d844c5..657a0a1b 100644 --- a/test/ares-test-fuzz.cc +++ b/test/ares-test-fuzz.cc @@ -2,8 +2,8 @@ #include // Entrypoint for Clang's libfuzzer -extern "C" void LLVMFuzzerTestOneInput(const unsigned char *data, - unsigned long size) { +extern "C" int LLVMFuzzerTestOneInput(const unsigned char *data, + unsigned long size) { // Feed the data into each of the ares_parse_*_reply functions. struct hostent *host = nullptr; struct ares_addrttl info[5]; @@ -41,4 +41,5 @@ extern "C" void LLVMFuzzerTestOneInput(const unsigned char *data, struct ares_soa_reply* soa = nullptr; ares_parse_soa_reply(data, size, &soa); if (soa) ares_free_data(soa); + return 0; }