about summary refs log tree commit diff
path: root/examples/aflpp_driver/aflpp_driver_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/aflpp_driver/aflpp_driver_test.c')
-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 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);