@@ -62,18 +62,20 @@ bool RxGlobal::evaluate(Transaction *transaction, RuleWithActions *rule,
62
62
63
63
// FIXME: DRY regex error reporting. This logic is currently duplicated in other operators.
64
64
if (regex_result != Utils::RegexResult::Ok) {
65
- transaction->m_variableMscPcreError .set (" 1" , transaction->m_variableOffset );
66
-
67
- std::string regex_error_str = " OTHER" ;
68
- if (regex_result == Utils::RegexResult::ErrorMatchLimit) {
69
- regex_error_str = " MATCH_LIMIT" ;
70
- transaction->m_variableMscPcreLimitsExceeded .set (" 1" , transaction->m_variableOffset );
71
- transaction->m_collections .m_tx_collection ->storeOrUpdateFirst (" MSC_PCRE_LIMITS_EXCEEDED" , " 1" );
72
- ms_dbg_a (transaction, 7 , " Set TX.MSC_PCRE_LIMITS_EXCEEDED to 1" );
65
+ if (transaction) {
66
+ transaction->m_variableMscPcreError .set (" 1" , transaction->m_variableOffset );
67
+
68
+ std::string regex_error_str = " OTHER" ;
69
+ if (regex_result == Utils::RegexResult::ErrorMatchLimit) {
70
+ regex_error_str = " MATCH_LIMIT" ;
71
+ transaction->m_variableMscPcreLimitsExceeded .set (" 1" , transaction->m_variableOffset );
72
+ transaction->m_collections .m_tx_collection ->storeOrUpdateFirst (" MSC_PCRE_LIMITS_EXCEEDED" , " 1" );
73
+ ms_dbg_a (transaction, 7 , " Set TX.MSC_PCRE_LIMITS_EXCEEDED to 1" );
74
+ }
75
+
76
+ ms_dbg_a (transaction, 1 , " rxGlobal: regex error '" + regex_error_str + " ' for pattern '" + re->pattern + " '" );
73
77
}
74
78
75
- ms_dbg_a (transaction, 1 , " rxGlobal: regex error '" + regex_error_str + " ' for pattern '" + re->pattern + " '" );
76
-
77
79
return false ;
78
80
}
79
81
0 commit comments