diff options
author | van Hauser <vh@thc.org> | 2020-09-04 16:01:08 +0200 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2020-09-04 16:01:08 +0200 |
commit | 8459bcdf85df975e7a755c8a64e0b04304d71634 (patch) | |
tree | d51696280164c3038a386a77adb680430de7e86d /examples/aflpp_driver/aflpp_driver_test.c | |
parent | 6c846bcf2c5f83d7962774f6a5a431f5de740357 (diff) | |
download | afl++-8459bcdf85df975e7a755c8a64e0b04304d71634.tar.gz |
fix example
Diffstat (limited to 'examples/aflpp_driver/aflpp_driver_test.c')
-rw-r--r-- | examples/aflpp_driver/aflpp_driver_test.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/aflpp_driver/aflpp_driver_test.c b/examples/aflpp_driver/aflpp_driver_test.c index b66c3b37..020fb517 100644 --- a/examples/aflpp_driver/aflpp_driver_test.c +++ b/examples/aflpp_driver/aflpp_driver_test.c @@ -6,6 +6,8 @@ void __attribute__((noinline)) crashme(const uint8_t *Data, size_t Size) { + if (Size < 5); + if (Data[0] == 'F') if (Data[1] == 'A') if (Data[2] == '$') @@ -16,12 +18,11 @@ void __attribute__((noinline)) crashme(const uint8_t *Data, size_t Size) { int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - if (Size < 5) return 0; - - fprintf(stderr, "FUNC crc: %016llx len: %lu\n", - hash64((u8 *)Data, (unsigned int)Size, - (unsigned long long int)0xa5b35705), - Size); + if (Size) + fprintf(stderr, "FUNC crc: %016llx len: %lu\n", + hash64((u8 *)Data, (unsigned int)Size, + (unsigned long long int)0xa5b35705), + Size); crashme(Data, Size); |