about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authormark0 <757410129@qq.com>2023-07-28 17:32:59 +0800
committermark0 <757410129@qq.com>2023-07-28 17:32:59 +0800
commitbd1648e707b85b79d816fd8737909789d7d2a09c (patch)
treee24935f2cebb2634cc5621ab48689b9741bfa720 /src
parent705cdf45fc32e6f5fcf3b8e58242ede3b99b8b6e (diff)
downloadafl++-bd1648e707b85b79d816fd8737909789d7d2a09c.tar.gz
fix the file descriptor without determining null
Diffstat (limited to 'src')
-rw-r--r--src/afl-showmap.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/afl-showmap.c b/src/afl-showmap.c
index b82bcd72..7a639cf6 100644
--- a/src/afl-showmap.c
+++ b/src/afl-showmap.c
@@ -1611,6 +1611,7 @@ int main(int argc, char **argv_orig, char **envp) {
   if (in_dir || in_filelist) {
 
     afl->fsrv.dev_urandom_fd = open("/dev/urandom", O_RDONLY);
+    if (afl->fsrv.dev_urandom_fd < 0) { PFATAL("Unable to open /dev/urandom"); }
     afl->afl_env.afl_custom_mutator_library =
         getenv("AFL_CUSTOM_MUTATOR_LIBRARY");
     afl->afl_env.afl_python_module = getenv("AFL_PYTHON_MODULE");