From: rl1987 Date: Mon, 6 May 2019 14:21:11 +0000 (+0300) Subject: Don't forget to use the mutex in testing_enable_prefilled_rng() X-Git-Tag: tor-0.4.1.1-alpha~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=49acbfad23df415977fb7a196c6aae2d7406b489;p=thirdparty%2Ftor.git Don't forget to use the mutex in testing_enable_prefilled_rng() --- diff --git a/src/test/rng_test_helpers.c b/src/test/rng_test_helpers.c index 262d380bda..d268cb64b7 100644 --- a/src/test/rng_test_helpers.c +++ b/src/test/rng_test_helpers.c @@ -185,10 +185,14 @@ testing_enable_prefilled_rng(const void *buffer, size_t buflen) tor_assert(buflen > 0); rng_mutex = tor_mutex_new(); + tor_mutex_acquire(rng_mutex); + prefilled_rng_buffer = tor_memdup(buffer, buflen); prefilled_rng_buflen = buflen; prefilled_rng_idx = 0; + tor_mutex_release(rng_mutex); + MOCK(crypto_rand, crypto_rand_prefilled); MOCK(crypto_strongest_rand_, mock_crypto_strongest_rand); }