Skip to content

Commit f011260

Browse files
micha137Felipe Zimmerle
authored andcommitted
Remove misguided call to srand()
A random number generator needs to be initialized once per process after a fork, but not after each request, more so with an argument that changes only once per second. This fixes SpiderLabs#778 This is a copy of my commit deec149.
1 parent 4a49d5b commit f011260

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

apache2/modsecurity.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,6 @@ static void modsecurity_persist_data(modsec_rec *msr) {
237237
}
238238

239239
/* Remove stale collections. */
240-
srand(time(NULL));
241-
242240
if (rand() < RAND_MAX/100) {
243241
arr = apr_table_elts(msr->collections);
244242
te = (apr_table_entry_t *)arr->elts;

0 commit comments

Comments
 (0)