about summary refs log tree commit diff
path: root/instrumentation/afl-compiler-rt.o.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2023-10-03 10:34:25 +0200
committerGitHub <noreply@github.com>2023-10-03 10:34:25 +0200
commit63100d2012038ce67bdf20b624c8c53afd4b99c7 (patch)
tree227f6d6086215f5091743d69d778f0e3c27b7a94 /instrumentation/afl-compiler-rt.o.c
parent1f7f1eff4323720997079d468c9a55096ac2fc3e (diff)
parentd9462657a892311f818330c9df128af09e704ae2 (diff)
downloadafl++-63100d2012038ce67bdf20b624c8c53afd4b99c7.tar.gz
Merge pull request #1879 from AFLplusplus/urandom
Use /dev/urandom for area_is_valid check
Diffstat (limited to 'instrumentation/afl-compiler-rt.o.c')
-rw-r--r--instrumentation/afl-compiler-rt.o.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/instrumentation/afl-compiler-rt.o.c b/instrumentation/afl-compiler-rt.o.c
index 723b946b..85ee9f71 100644
--- a/instrumentation/afl-compiler-rt.o.c
+++ b/instrumentation/afl-compiler-rt.o.c
@@ -666,8 +666,8 @@ static void __afl_map_shm(void) {
   }
 
   if (id_str) {
-
-    if ((__afl_dummy_fd[1] = open("/dev/null", O_WRONLY)) < 0) {
+    // /dev/null doesn't work so we use /dev/urandom
+    if ((__afl_dummy_fd[1] = open("/dev/urandom", O_WRONLY)) < 0) {
 
       if (pipe(__afl_dummy_fd) < 0) { __afl_dummy_fd[1] = 1; }