mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 21:36:00 +03:00
Add the PCRE_DOLLAR_ENDONLY option when compiling regular expression for the @rx operator and variables. (trac #57)
This commit is contained in:
parent
a93c77e9a2
commit
00dcb2714f
5
CHANGES
5
CHANGES
@ -1,7 +1,10 @@
|
|||||||
|
|
||||||
21 Mar 2007 - trunk
|
?? ??? 2007 - trunk
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
* Add the PCRE_DOLLAR_ENDONLY option when compiling regular expression
|
||||||
|
for the @rx operator and variables.
|
||||||
|
|
||||||
* Really set PCRE_DOTALL option when compiling the regular expression
|
* Really set PCRE_DOTALL option when compiling the regular expression
|
||||||
for the @rx operator as the docs state.
|
for the @rx operator as the docs state.
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ static int msre_op_rx_param_init(msre_rule *rule, char **error_msg) {
|
|||||||
*error_msg = NULL;
|
*error_msg = NULL;
|
||||||
|
|
||||||
/* Compile pattern */
|
/* Compile pattern */
|
||||||
regex = msc_pregcomp(rule->ruleset->mp, pattern, PCRE_DOTALL, &errptr, &erroffset);
|
regex = msc_pregcomp(rule->ruleset->mp, pattern, PCRE_DOTALL | PCRE_DOLLAR_ENDONLY, &errptr, &erroffset);
|
||||||
if (regex == NULL) {
|
if (regex == NULL) {
|
||||||
*error_msg = apr_psprintf(rule->ruleset->mp, "Error compiling pattern (pos %i): %s",
|
*error_msg = apr_psprintf(rule->ruleset->mp, "Error compiling pattern (pos %i): %s",
|
||||||
erroffset, errptr);
|
erroffset, errptr);
|
||||||
|
@ -69,7 +69,7 @@ static char *var_generic_list_validate(msre_ruleset *ruleset, msre_var *var) {
|
|||||||
pattern = apr_pstrmemdup(ruleset->mp, var->param + 1, strlen(var->param + 1) - 1);
|
pattern = apr_pstrmemdup(ruleset->mp, var->param + 1, strlen(var->param + 1) - 1);
|
||||||
if (pattern == NULL) return FATAL_ERROR;
|
if (pattern == NULL) return FATAL_ERROR;
|
||||||
|
|
||||||
regex = msc_pregcomp(ruleset->mp, pattern, PCRE_DOTALL | PCRE_CASELESS, &errptr, &erroffset);
|
regex = msc_pregcomp(ruleset->mp, pattern, PCRE_DOTALL | PCRE_CASELESS | PCRE_DOLLAR_ENDONLY, &errptr, &erroffset);
|
||||||
if (regex == NULL) {
|
if (regex == NULL) {
|
||||||
return apr_psprintf(ruleset->mp, "Error compiling pattern (pos %i): %s",
|
return apr_psprintf(ruleset->mp, "Error compiling pattern (pos %i): %s",
|
||||||
erroffset, errptr);
|
erroffset, errptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user