about summary refs log tree commit diff
path: root/frida_mode/test/unstable/unstable.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-08-08 15:27:07 +0200
committerGitHub <noreply@github.com>2022-08-08 15:27:07 +0200
commit3e2986dd78dbc45035b47a34eedd7dd1b9a4d0b3 (patch)
tree051a91a2a36a1c768870591634eca83c62e6053c /frida_mode/test/unstable/unstable.c
parenta2f3c3ee519c19935039d1fe1e8b77cdc32fa375 (diff)
parent1f06b55a8b558bd8da0296134c29c21c4849a4bd (diff)
downloadafl++-4.02c.tar.gz
Merge pull request #1489 from AFLplusplus/dev 4.02c
push to stable
Diffstat (limited to 'frida_mode/test/unstable/unstable.c')
-rw-r--r--frida_mode/test/unstable/unstable.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/frida_mode/test/unstable/unstable.c b/frida_mode/test/unstable/unstable.c
index 915e283f..7d16c26c 100644
--- a/frida_mode/test/unstable/unstable.c
+++ b/frida_mode/test/unstable/unstable.c
@@ -14,6 +14,7 @@
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <sys/time.h>
 
 #ifdef __APPLE__
   #define TESTINSTR_SECTION
@@ -25,8 +26,10 @@ void LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
 
   if (size < 1) return;
 
-  int r = rand();
-  if ((r % 2) == 0) {
+  struct timeval tv = {0};
+  if (gettimeofday(&tv, NULL) < 0) return;
+
+  if ((tv.tv_usec % 2) == 0) {
     printf ("Hooray all even\n");
   } else {
     printf ("Hmm that's odd\n");