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-29 18:19:35 +0200
committerGitHub <noreply@github.com>2020-06-29 18:19:35 +0200
commit8f1b78f49e8efef8ec089230d732cdee7b37fa9a (patch)
tree4cb5e6e59f24f488e58fbb1aced2dbc0e6550c15 /src/afl-analyze.c
parent12bdefe00e38cdc3dd8cb028eeac325ab2e94e16 (diff)
parent3a0c91b86205bfebb8ec7e62a2e7b0bfcec2e407 (diff)
downloadafl++-8f1b78f49e8efef8ec089230d732cdee7b37fa9a.tar.gz
Merge pull request #426 from AFLplusplus/dev
Dev
Diffstat (limited to 'src/afl-analyze.c')
-rw-r--r--src/afl-analyze.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/afl-analyze.c b/src/afl-analyze.c
index 900fbeb1..56284f6f 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. */
@@ -1046,6 +1049,9 @@ int main(int argc, char **argv, char **envp) {
   check_environment_vars(envp);
 
   sharedmem_t shm = {0};
+
+  /* initialize cmplog_mode */
+  shm.cmplog_mode = 0;
   trace_bits = afl_shm_init(&shm, map_size, 0);
   atexit(at_exit_handler);
   setup_signal_handlers();