Skip to content

Commit deec149

Browse files
author
Michael Bunk
committed
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 owasp-modsecurity#778
1 parent a0f91de commit deec149

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
@@ -223,8 +223,6 @@ static void modsecurity_persist_data(modsec_rec *msr) {
223223
}
224224

225225
/* Remove stale collections. */
226-
srand(time(NULL));
227-
228226
if (rand() < RAND_MAX/100) {
229227
arr = apr_table_elts(msr->collections);
230228
te = (apr_table_entry_t *)arr->elts;

0 commit comments

Comments
 (0)