]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
When compiling for fuzzing, ensure the pseudo random number seed is non-zero.
authorStephen Morris <stephen@isc.org>
Wed, 28 Nov 2018 18:27:06 +0000 (18:27 +0000)
committerStephen Morris <stephen@isc.org>
Fri, 30 Nov 2018 11:21:55 +0000 (11:21 +0000)
lib/isc/random.c

index 54a60a072eb11229d25bf458a903b4363491e4da..0c1930d980ca57ddefd8db030f4013738d45906a 100644 (file)
@@ -80,7 +80,13 @@ static isc_once_t isc_random_once = ISC_ONCE_INIT;
 static void
 isc_random_initialize(void) {
 #if FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+       /*
+        * Set a constant seed to help in problem reproduction should fuzzing
+        * find a crash or a hang.  The seed array must be non-zero else
+        * xoshiro128starstar will generate an infinite series of zeroes.
+        */
        memset(seed, 0, sizeof(seed));
+       seed[0] = 1;
 #else
        int useed[4] = {0,0,0,0};
        isc_entropy_get(useed, sizeof(useed));