mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
fixup! When compiling for fuzzing, ensure the pseudo random number seed is non-zero.
This commit is contained in:
parent
77032a4e29
commit
d13cabd27e
1 changed files with 2 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue