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

Commit72f632e

Browse files
Daniel Stelter-GlieseFelipe Zimmerle
Daniel Stelter-Gliese
authored and
Felipe Zimmerle
committed
Avoid additional operator invokation if last transform of a multimatch doesn't modify the input
Fixesowasp-modsecurity#1086
1 parent9ac9ff8 commit72f632e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

‎CHANGES‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
DD MMM YYYY - 2.9.2 - To be released
22
------------------------------------
33

4+
* Avoid additional operator invokation if last transform of a multimatch
5+
doesn't modify the input
6+
[Issue #1086, #1087 - Daniel Stelter-Gliese]
47
* Adds a sanity check before use ctl:ruleRemoveTargetByTag.
58
[Issue #1353 - @LukeP21 and @zimmerle]
69
* Uses an optional global lock while manipulating collections.

‎apache2/re.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2872,7 +2872,10 @@ static apr_status_t msre_rule_process_normal(msre_rule *rule, modsec_rec *msr) {
28722872
arr=apr_table_elts(tartab);
28732873
te= (apr_table_entry_t*)arr->elts;
28742874
for (i=0;i<arr->nelts;i++) {
2875+
/* Variable was modified by *any* transformation */
28752876
intchanged;
2877+
/* Variable was modified by *last applied* transformation (needed by multimatch) */
2878+
inttfnchanged;
28762879
intusecache=0;
28772880
apr_table_t*cachetab=NULL;
28782881
apr_time_ttime_before_trans=0;
@@ -2995,8 +2998,8 @@ static apr_status_t msre_rule_process_normal(msre_rule *rule, modsec_rec *msr) {
29952998
apr_table_t*normtab;
29962999
constchar*lastvarval=NULL;
29973000
apr_size_tlastvarlen=0;
2998-
inttfnchanged=0;
29993001

3002+
tfnchanged=0;
30003003
changed=0;
30013004
normtab=apr_table_make(mptmp,10);
30023005
if (normtab==NULL)return-1;
@@ -3278,7 +3281,7 @@ static apr_status_t msre_rule_process_normal(msre_rule *rule, modsec_rec *msr) {
32783281
* or if it is and we need to process the result of the
32793282
* last transformation.
32803283
*/
3281-
if (!multi_match||changed) {
3284+
if (!multi_match||tfnchanged) {
32823285
invocations++;
32833286

32843287
#if defined(PERFORMANCE_MEASUREMENT)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp