mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-16 07:56:12 +03:00
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 deec149ca363dd14213afd1f9d7f71a71959ef31.
This commit is contained in:
parent
4a49d5b8dc
commit
f0112604a6
@ -237,8 +237,6 @@ static void modsecurity_persist_data(modsec_rec *msr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Remove stale collections. */
|
/* Remove stale collections. */
|
||||||
srand(time(NULL));
|
|
||||||
|
|
||||||
if (rand() < RAND_MAX/100) {
|
if (rand() < RAND_MAX/100) {
|
||||||
arr = apr_table_elts(msr->collections);
|
arr = apr_table_elts(msr->collections);
|
||||||
te = (apr_table_entry_t *)arr->elts;
|
te = (apr_table_entry_t *)arr->elts;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user