Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4f55b5d

Browse files
bostrtFelipe Zimmerle
authored and
Felipe Zimmerle
committed
Change from using rand() to thread-safe ap_random_pick.
1 parentcd4218b commit4f55b5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎apache2/modsecurity.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ static void modsecurity_persist_data(modsec_rec *msr) {
237237
}
238238

239239
/* Remove stale collections. */
240-
if (rand()<RAND_MAX/100) {
240+
if (ap_random_pick(0,RAND_MAX)<RAND_MAX/100) {
241241
arr=apr_table_elts(msr->collections);
242242
te= (apr_table_entry_t*)arr->elts;
243243
for (i=0;i<arr->nelts;i++) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp