Skip to content

Commit 176276a

Browse files
author
Felipe Zimmerle
committed
Fix the order of error_msg validation
Reported by @marcstern at #2128
1 parent 28b4be6 commit 176276a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
DD mmm YYYY - 2.9.x (to be released)
22
------------------------------------
33

4+
* Fix the order of error_msg validation
5+
[Issue #2128 - @marcstern, @zimmerle]
46
* Added missing Geo Countries
57
[Issue #2123, #2124 - @emphazer]
68
* When the input filter finishes, check whether we returned data

apache2/re_operators.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,9 @@ static int msre_op_within_execute(modsec_rec *msr, msre_rule *rule, msre_var *va
19931993
unsigned int target_length = 0;
19941994
unsigned int i, i_max;
19951995

1996+
if (error_msg == NULL) return -1;
1997+
*error_msg = NULL;
1998+
19961999
str->value = (char *)rule->op_param;
19972000

19982001
if (str->value == NULL) {
@@ -2002,9 +2005,6 @@ static int msre_op_within_execute(modsec_rec *msr, msre_rule *rule, msre_var *va
20022005

20032006
str->value_len = strlen(str->value);
20042007

2005-
if (error_msg == NULL) return -1;
2006-
*error_msg = NULL;
2007-
20082008
expand_macros(msr, str, rule, msr->mp);
20092009

20102010
match = (const char *)str->value;

0 commit comments

Comments
 (0)