From 49acbfad23df415977fb7a196c6aae2d7406b489 Mon Sep 17 00:00:00 2001 From: rl1987 Date: Mon, 6 May 2019 17:21:11 +0300 Subject: [PATCH] Don't forget to use the mutex in testing_enable_prefilled_rng() --- src/test/rng_test_helpers.c | 4 ++++ 1 file changed, 4 insertions(+) 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); } -- 2.11.4.GIT