mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Change from using rand() to thread-safe ap_random_pick.
This commit is contained in:
committed by
Felipe Zimmerle
parent
cd4218bd40
commit
4f55b5d1a7
@@ -237,7 +237,7 @@ static void modsecurity_persist_data(modsec_rec *msr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Remove stale collections. */
|
/* Remove stale collections. */
|
||||||
if (rand() < RAND_MAX/100) {
|
if (ap_random_pick(0, RAND_MAX) < 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;
|
||||||
for (i = 0; i < arr->nelts; i++) {
|
for (i = 0; i < arr->nelts; i++) {
|
||||||
|
Reference in New Issue
Block a user