Skip to content

Commit ddb0aa3

Browse files
use of apr_snprintf
1 parent 8765d83 commit ddb0aa3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apache2/re.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -996,11 +996,11 @@ static int apr_table_action_exists(apr_pool_t* p, const apr_table_t* vartable, c
996996
if (!vars) return 0;
997997

998998
char pattern[200];
999-
sprintf(pattern, "(?:^|,)%.185s(?:,|$)", value);
999+
apr_snprintf(pattern, sizeof(pattern), "(?:^|,)%.185s(?:,|$)", value);
10001000

10011001
char* error_msg = NULL;
10021002
msc_regex_t* regex = msc_pregcomp(p, pattern, 0, NULL, NULL);
1003-
if (regex == NULL) return 0; // we could log an error here
1003+
if (regex == NULL) return 0;
10041004

10051005
return (msc_regexec(regex, vars, strlen(vars), &error_msg) >= 0);
10061006
}

0 commit comments

Comments
 (0)