diff options
author | van Hauser <vh@thc.org> | 2020-09-04 22:48:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-04 22:48:46 +0200 |
commit | 4f7a8a4c70de1b93b1dccd8f2bf092ec4b3626dc (patch) | |
tree | 8c81a16ba76661b0df5307b9964275ff529d4deb /examples/aflpp_driver/aflpp_driver_test.c | |
parent | 7f621509eee57f0b6fd9ad542adc4f2acafeb059 (diff) | |
parent | 976ee9022cda95e0715b82ff866098ad293117c9 (diff) | |
download | afl++-4f7a8a4c70de1b93b1dccd8f2bf092ec4b3626dc.tar.gz |
Merge pull request #542 from AFLplusplus/dev
push to stable
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 ddc3effb..b4ff6bc6 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) return; + 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) { - fprintf(stderr, "FUNC crc: %016llx len: %lu\n", - hash64((u8 *)Data, (unsigned int)Size, - (unsigned long long int)0xa5b35705), - Size); - - if (Size < 5) return 0; + 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); |