Fix the order of error_msg validation

Reported by @marcstern at #2128
This commit is contained in:
Felipe Zimmerle 2019-07-10 14:41:32 -03:00
parent 28b4be670f
commit 176276a931
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277
2 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,8 @@
DD mmm YYYY - 2.9.x (to be released)
------------------------------------
* Fix the order of error_msg validation
[Issue #2128 - @marcstern, @zimmerle]
* Added missing Geo Countries
[Issue #2123, #2124 - @emphazer]
* When the input filter finishes, check whether we returned data

View File

@ -1993,6 +1993,9 @@ static int msre_op_within_execute(modsec_rec *msr, msre_rule *rule, msre_var *va
unsigned int target_length = 0;
unsigned int i, i_max;
if (error_msg == NULL) return -1;
*error_msg = NULL;
str->value = (char *)rule->op_param;
if (str->value == NULL) {
@ -2002,9 +2005,6 @@ static int msre_op_within_execute(modsec_rec *msr, msre_rule *rule, msre_var *va
str->value_len = strlen(str->value);
if (error_msg == NULL) return -1;
*error_msg = NULL;
expand_macros(msr, str, rule, msr->mp);
match = (const char *)str->value;