|
1 | 1 | /*
|
2 | 2 | * ModSecurity for Apache 2.x, http://www.modsecurity.org/
|
3 |
| -* Copyright (c) 2004-2022 Trustwave Holdings, Inc. (http://www.trustwave.com/) |
| 3 | +* Copyright (c) 2004-2023 Trustwave Holdings, Inc. (http://www.trustwave.com/) |
4 | 4 | *
|
5 | 5 | * You may not use this file except in compliance with
|
6 | 6 | * the License. You may obtain a copy of the License at
|
@@ -1024,7 +1024,7 @@ static int msre_op_rx_execute(modsec_rec *msr, msre_rule *rule, msre_var *var, c
|
1024 | 1024 | int matched = 0;
|
1025 | 1025 | int rc;
|
1026 | 1026 | char *qspos = NULL;
|
1027 |
| - const char *parm = NULL, *pattern = NULL; |
| 1027 | + const char *parm = NULL; |
1028 | 1028 | msc_parm *mparm = NULL;
|
1029 | 1029 | #ifdef WITH_PCRE_STUDY
|
1030 | 1030 | #ifdef WITH_PCRE_JIT
|
@@ -1052,17 +1052,17 @@ static int msre_op_rx_execute(modsec_rec *msr, msre_rule *rule, msre_var *var, c
|
1052 | 1052 |
|
1053 | 1053 | expand_macros(msr, re_pattern, rule, msr->mp);
|
1054 | 1054 |
|
1055 |
| - pattern = log_escape_re(msr->mp, re_pattern->value); |
1056 | 1055 | if (msr->txcfg->debuglog_level >= 6) {
|
1057 |
| - msr_log(msr, 6, "Escaping pattern [%s]",pattern); |
| 1056 | + char *pattern = log_escape_re(msr->mp, re_pattern->value); |
| 1057 | + msr_log(msr, 6, "Expanded-macro pattern [%s]",pattern); |
1058 | 1058 | }
|
1059 | 1059 |
|
1060 | 1060 | #ifdef WITH_PCRE2
|
1061 | 1061 | options = PCRE2_DOTALL | PCRE2_DOLLAR_ENDONLY;
|
1062 | 1062 | #else
|
1063 | 1063 | options = PCRE_DOTALL | PCRE_DOLLAR_ENDONLY;
|
1064 | 1064 | #endif
|
1065 |
| - regex = msc_pregcomp_ex(msr->mp, pattern, options, &errptr, &erroffset, msc_pcre_match_limit, msc_pcre_match_limit_recursion); |
| 1065 | + regex = msc_pregcomp_ex(msr->mp, re_pattern->value, options, &errptr, &erroffset, msc_pcre_match_limit, msc_pcre_match_limit_recursion); |
1066 | 1066 | if (regex == NULL) {
|
1067 | 1067 | *error_msg = apr_psprintf(msr->mp, "Error compiling pattern (offset %d): %s",
|
1068 | 1068 | erroffset, errptr);
|
|
0 commit comments