From: James Jones Date: Wed, 11 May 2022 21:06:40 +0000 (-0500) Subject: Use fr_fast_rand() to select operation in burn-in (CID #1503935, #1504015) (#4503) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=836667d65adfc83602cac78f6bfb8650cfeac8d7;p=thirdparty%2Ffreeradius-server.git Use fr_fast_rand() to select operation in burn-in (CID #1503935, #1504015) (#4503) --- diff --git a/src/lib/util/lst_tests.c b/src/lib/util/lst_tests.c index 092dcb391fa..4caa738b8e6 100644 --- a/src/lib/util/lst_tests.c +++ b/src/lib/util/lst_tests.c @@ -280,7 +280,7 @@ static void lst_burn_in(void) TEST_CHECK((ret_insert = fr_lst_insert(lst, &array[insert_count])) >= 0); insert_count++; } else { - switch (rand() % 3) { + switch (fr_fast_rand(&rand_ctx) % 3) { case 0: /* insert */ goto insert; diff --git a/src/lib/util/minmax_heap_tests.c b/src/lib/util/minmax_heap_tests.c index 0b4c29e9262..c3b2216f5d0 100644 --- a/src/lib/util/minmax_heap_tests.c +++ b/src/lib/util/minmax_heap_tests.c @@ -250,7 +250,7 @@ static void minmax_heap_burn_in(void) TEST_CHECK((ret_insert = fr_minmax_heap_insert(hp, &array[insert_count])) >= 0); insert_count++; } else { - switch (rand() % 5) { + switch (fr_fast_rand(&rand_ctx) % 5) { case 0: /* insert */ goto insert;