@@ -62,18 +62,20 @@ bool RxGlobal::evaluate(Transaction *transaction, RuleWithActions *rule,
6262
6363 // FIXME: DRY regex error reporting. This logic is currently duplicated in other operators.
6464 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 + " '" );
7377 }
7478
75- ms_dbg_a (transaction, 1 , " rxGlobal: regex error '" + regex_error_str + " ' for pattern '" + re->pattern + " '" );
76-
7779 return false ;
7880 }
7981
0 commit comments