diff options
author | van Hauser <vh@thc.org> | 2023-07-28 13:19:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-28 13:19:21 +0200 |
commit | 57c9dfda1fabe150fad18d15ae3a49918c61fc19 (patch) | |
tree | e24935f2cebb2634cc5621ab48689b9741bfa720 /test/unittests/unit_rand.c | |
parent | 705cdf45fc32e6f5fcf3b8e58242ede3b99b8b6e (diff) | |
parent | bd1648e707b85b79d816fd8737909789d7d2a09c (diff) | |
download | afl++-57c9dfda1fabe150fad18d15ae3a49918c61fc19.tar.gz |
Merge pull request #1815 from mark0-cn/dev
fix the file descriptor without determining null
Diffstat (limited to 'test/unittests/unit_rand.c')
-rw-r--r-- | test/unittests/unit_rand.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/unittests/unit_rand.c b/test/unittests/unit_rand.c index 1ad02a80..f89b2ab5 100644 --- a/test/unittests/unit_rand.c +++ b/test/unittests/unit_rand.c @@ -67,6 +67,7 @@ static void test_rand_below(void **state) { rand_set_seed(&afl, 1337); afl.fsrv.dev_urandom_fd = open("/dev/urandom", O_RDONLY); + if (afl.fsrv.dev_urandom_fd < 0) { PFATAL("Unable to open /dev/urandom"); } assert(!(rand_below(&afl, 9000) > 9000)); assert_int_equal(rand_below(&afl, 1), 0); |