Skip to content

Commit 3f6c14d

Browse files
committed
Fixed msc_test crash using pcre jit in some platforms
1 parent f6bf1a2 commit 3f6c14d

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

apache2/re_operators.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,8 @@ static int msre_op_validateHash_param_init(msre_rule *rule, char **error_msg) {
764764
"Rule %pp [id \"%s\"][file \"%s\"][line \"%d\"] - "
765765
"Execution error - "
766766
"Does not support JIT (%d)",
767-
rule,((rule->actionset != NULL)&&(rule->actionset->id != NULL)) ? rule->actionset->id : "-",
767+
rule,((rule->actionset != NULL)&&((rule->actionset->id != NULL)&&
768+
(rule->actionset->id != NOT_SET_P))) ? rule->actionset->id : "-",
768769
rule->filename != NULL ? rule->filename : "-",
769770
rule->line_num,rc);
770771
}
@@ -854,7 +855,8 @@ static int msre_op_validateHash_execute(modsec_rec *msr, msre_rule *rule, msre_v
854855
"Rule %pp [id \"%s\"][file \"%s\"][line \"%d\"] - "
855856
"Execution error - "
856857
"Does not support JIT (%d)",
857-
rule,((rule->actionset != NULL)&&(rule->actionset->id != NULL)) ? rule->actionset->id : "-",
858+
rule,((rule->actionset != NULL)&&((rule->actionset->id != NULL)&&
859+
(rule->actionset->id != NOT_SET_P))) ? rule->actionset->id : "-",
858860
rule->filename != NULL ? rule->filename : "-",
859861
rule->line_num,rc);
860862
msr_log(msr, 4, "%s.", *error_msg);
@@ -1005,7 +1007,8 @@ static int msre_op_rx_param_init(msre_rule *rule, char **error_msg) {
10051007
"Rule %pp [id \"%s\"][file \"%s\"][line \"%d\"] - "
10061008
"Execution error - "
10071009
"Does not support JIT (%d)",
1008-
rule,((rule->actionset != NULL)&&(rule->actionset->id != NULL)) ? rule->actionset->id : "-",
1010+
rule,((rule->actionset != NULL)&&((rule->actionset->id != NULL)&&
1011+
(rule->actionset->id != NOT_SET_P))) ? rule->actionset->id : "-",
10091012
rule->filename != NULL ? rule->filename : "-",
10101013
rule->line_num,rc);
10111014
}
@@ -1085,7 +1088,8 @@ static int msre_op_rx_execute(modsec_rec *msr, msre_rule *rule, msre_var *var, c
10851088
"Rule %pp [id \"%s\"][file \"%s\"][line \"%d\"] - "
10861089
"Execution error - "
10871090
"Does not support JIT (%d)",
1088-
rule,((rule->actionset != NULL)&&(rule->actionset->id != NULL)) ? rule->actionset->id : "-",
1091+
rule,((rule->actionset != NULL)&&((rule->actionset->id != NULL)&&
1092+
(rule->actionset->id != NOT_SET_P))) ? rule->actionset->id : "-",
10891093
rule->filename != NULL ? rule->filename : "-",
10901094
rule->line_num,rc);
10911095
msr_log(msr, 4, "%s.", *error_msg);
@@ -2712,7 +2716,8 @@ static int msre_op_verifyCC_execute(modsec_rec *msr, msre_rule *rule, msre_var *
27122716
"Rule %pp [id \"%s\"][file \"%s\"][line \"%d\"] - "
27132717
"Execution error - "
27142718
"Does not support JIT (%d)",
2715-
rule,((rule->actionset != NULL)&&(rule->actionset->id != NULL)) ? rule->actionset->id : "-",
2719+
rule,((rule->actionset != NULL)&&((rule->actionset->id != NULL)&&
2720+
(rule->actionset->id != NOT_SET_P))) ? rule->actionset->id : "-",
27162721
rule->filename != NULL ? rule->filename : "-",
27172722
rule->line_num,rc);
27182723
msr_log(msr, 4, "%s.", *error_msg);
@@ -3020,7 +3025,8 @@ static int msre_op_verifyCPF_execute(modsec_rec *msr, msre_rule *rule, msre_var
30203025
"Rule %pp [id \"%s\"][file \"%s\"][line \"%d\"] - "
30213026
"Execution error - "
30223027
"Does not support JIT (%d)",
3023-
rule,((rule->actionset != NULL)&&(rule->actionset->id != NULL)) ? rule->actionset->id : "-",
3028+
rule,((rule->actionset != NULL)&&((rule->actionset->id != NULL)&&
3029+
(rule->actionset->id != NOT_SET_P))) ? rule->actionset->id : "-",
30243030
rule->filename != NULL ? rule->filename : "-",
30253031
rule->line_num,rc);
30263032
msr_log(msr, 4, "%s.", *error_msg);
@@ -3311,7 +3317,8 @@ static int msre_op_verifySSN_execute(modsec_rec *msr, msre_rule *rule, msre_var
33113317
"Rule %pp [id \"%s\"][file \"%s\"][line \"%d\"] - "
33123318
"Execution error - "
33133319
"Does not support JIT (%d)",
3314-
rule,((rule->actionset != NULL)&&(rule->actionset->id != NULL)) ? rule->actionset->id : "-",
3320+
rule,((rule->actionset != NULL)&&((rule->actionset->id != NULL)&&
3321+
(rule->actionset->id != NOT_SET_P))) ? rule->actionset->id : "-",
33153322
rule->filename != NULL ? rule->filename : "-",
33163323
rule->line_num,rc);
33173324
msr_log(msr, 4, "%s.", *error_msg);

0 commit comments

Comments
 (0)