From: Petteri Aimonen Date: Thu, 1 Oct 2015 14:38:10 +0000 (+0300) Subject: Fix bug in fuzzstub. X-Git-Tag: 5.0.2~186^2~105 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=be9c9bb55cea9ddac4c47041a5875f824629d03e;p=apps%2Fagl-service-can-low-level.git Fix bug in fuzzstub. The fread call always returned a message length of 1 byte, making the fuzz stub used for external fuzzers useless. The normal fuzztest.c was unaffected. Bug found using afl-fuzz. --- diff --git a/tests/fuzztest/fuzzstub.c b/tests/fuzztest/fuzzstub.c index ce14b9ba..ec9e2afe 100644 --- a/tests/fuzztest/fuzzstub.c +++ b/tests/fuzztest/fuzzstub.c @@ -165,7 +165,7 @@ static void run_iteration() size_t msglen; bool status; - msglen = fread(buffer, BUFSIZE, 1, stdin); + msglen = fread(buffer, 1, BUFSIZE, stdin); status = do_static_decode(buffer, msglen, false);