aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/aflpp_driver/aflpp_driver_test.c13
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);