about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-06-21 14:08:41 +0200
committervan Hauser <vh@thc.org>2020-06-21 14:08:41 +0200
commitb0866f59ccbcd90c2c3e0ecbb5ba2d9badc60319 (patch)
tree1980ebccb3e220b2fc49f6266aa052f367e948dd
parentb3b016a4a3f15ea22eccd06b47dbf9749b6f08ec (diff)
downloadafl++-b0866f59ccbcd90c2c3e0ecbb5ba2d9badc60319.tar.gz
fix for -s 0
-rw-r--r--src/afl-fuzz.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index cefcd73f..c3b2da29 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -823,8 +823,7 @@ int main(int argc, char **argv_orig, char **envp) {
 
     WARNF(
         "Using -M main node with the AFL_CUSTOM_MUTATOR_ONLY mutator options "
-        "will "
-        "result in no deterministic mutations being done!");
+        "will result in no deterministic mutations being done!");
 
   }
 
@@ -836,10 +835,11 @@ int main(int argc, char **argv_orig, char **envp) {
 
   if (afl->init_seed) {
 
-    afl->rand_seed[0] = afl->init_seed;
-    afl->rand_seed[1] = afl->init_seed ^ 0x1234567890abcdef;
-    afl->rand_seed[2] = afl->init_seed & 0x0123456789abcdef;
-    afl->rand_seed[3] = afl->init_seed | 0x01abcde43f567908;
+    afl->rand_seed[0] =
+        hash64((void *)&afl->init_seed, sizeof(u32), HASH_CONST);
+    afl->rand_seed[1] = afl->rand_seed[0] ^ 0x1234567890abcdef;
+    afl->rand_seed[2] = afl->rand_seed[0] & 0x0123456789abcdef;
+    afl->rand_seed[3] = afl->rand_seed[0] | 0x01abcde43f567908;
 
   }