2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

When compiling for fuzzing, ensure the pseudo random number seed is non-zero.

This commit is contained in:
Stephen Morris
2018-11-28 18:27:06 +00:00
parent 73bc3147d1
commit 77032a4e29

View 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));