From: Ondřej Surý Date: Wed, 28 Nov 2018 21:49:42 +0000 (+0100) Subject: fixup! When compiling for fuzzing, ensure the pseudo random number seed is non-zero. X-Git-Tag: v9.13.5~22^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d13cabd27e95a529753242c9163beaba8d9e7848;p=thirdparty%2Fbind9.git fixup! When compiling for fuzzing, ensure the pseudo random number seed is non-zero. --- diff --git a/lib/isc/random.c b/lib/isc/random.c index 0c1930d980c..4be9292408b 100644 --- a/lib/isc/random.c +++ b/lib/isc/random.c @@ -79,19 +79,17 @@ static isc_once_t isc_random_once = ISC_ONCE_INIT; static void isc_random_initialize(void) { + int useed[4] = {0,0,0,1}; #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)); - memcpy(seed, useed, sizeof(seed)); #endif + memcpy(seed, useed, sizeof(seed)); } uint8_t