From deec149ca363dd14213afd1f9d7f71a71959ef31 Mon Sep 17 00:00:00 2001 From: Michael Bunk Date: Wed, 29 Oct 2014 12:21:21 +0100 Subject: [PATCH] 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 https://github.com/SpiderLabs/ModSecurity/issues/778 --- apache2/modsecurity.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/apache2/modsecurity.c b/apache2/modsecurity.c index 1260f38c..35c2a140 100644 --- a/apache2/modsecurity.c +++ b/apache2/modsecurity.c @@ -223,8 +223,6 @@ static void modsecurity_persist_data(modsec_rec *msr) { } /* Remove stale collections. */ - srand(time(NULL)); - if (rand() < RAND_MAX/100) { arr = apr_table_elts(msr->collections); te = (apr_table_entry_t *)arr->elts;