about summary refs log tree commit diff
path: root/src/afl-analyze.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-06-17 15:05:14 +0200
committerGitHub <noreply@github.com>2020-06-17 15:05:14 +0200
commit0dc9967984df3f9c250d4c27b6de1cbd4cac3eb3 (patch)
treeca6096f1d22ba87c262bdeaf57455520ef3143e2 /src/afl-analyze.c
parent12bdefe00e38cdc3dd8cb028eeac325ab2e94e16 (diff)
parent889e54eab858b1928f74a8c179b32275b62f2286 (diff)
downloadafl++-0dc9967984df3f9c250d4c27b6de1cbd4cac3eb3.tar.gz
Merge pull request #403 from AFLplusplus/dev
push to master
Diffstat (limited to 'src/afl-analyze.c')
-rw-r--r--src/afl-analyze.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/afl-analyze.c b/src/afl-analyze.c
index 900fbeb1..f9ba8860 100644
--- a/src/afl-analyze.c
+++ b/src/afl-analyze.c
@@ -51,7 +51,9 @@
 
 #include <sys/wait.h>
 #include <sys/time.h>
-#include <sys/shm.h>
+#ifndef USEMMAP
+  #include <sys/shm.h>
+#endif
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/resource.h>
@@ -66,11 +68,12 @@ static u8 *in_file,                    /* Analyzer input test case          */
 static u8 *in_data;                    /* Input data for analysis           */
 
 static u32 in_len,                     /* Input data length                 */
-    orig_cksum,                        /* Original checksum                 */
     total_execs,                       /* Total number of execs             */
     exec_hangs,                        /* Total number of hangs             */
     exec_tmout = EXEC_TIMEOUT;         /* Exec timeout (ms)                 */
 
+static u64 orig_cksum;                 /* Original checksum                 */
+
 static u64 mem_limit = MEM_LIMIT;      /* Memory limit (MB)                 */
 
 static s32 dev_null_fd = -1;           /* FD to /dev/null                   */
@@ -222,7 +225,7 @@ static u32 analyze_run_target(char **argv, u8 *mem, u32 len, u8 first_run) {
   int                     status = 0;
 
   s32 prog_in_fd;
-  u32 cksum;
+  u64 cksum;
 
   memset(trace_bits, 0, map_size);
   MEM_BARRIER();
@@ -321,7 +324,7 @@ static u32 analyze_run_target(char **argv, u8 *mem, u32 len, u8 first_run) {
 
   }
 
-  cksum = hash32(trace_bits, map_size, HASH_CONST);
+  cksum = hash64(trace_bits, map_size, HASH_CONST);
 
   /* We don't actually care if the target is crashing or not,
      except that when it does, the checksum should be different. */