@@ -1469,31 +1469,40 @@ int Transaction::processLogging() {
14691469 * @brief Check if ModSecurity has anything to ask to the server.
14701470 *
14711471 * Intervention can generate a log event and/or perform a disruptive action.
1472+ *
1473+ * If the return value is true, all fields in the ModSecurityIntervention
1474+ * parameter have been initialized and are safe to access.
1475+ * If the return value is false, no changes to the ModSecurityIntervention
1476+ * parameter have been made.
14721477 *
1473- * @param Pointer ModSecurityIntervention structure
1478+ * @param it Pointer to ModSecurityIntervention structure
14741479 * @retval true A intervention should be made.
14751480 * @retval false Nothing to be done.
14761481 *
14771482 */
14781483bool Transaction::intervention (ModSecurityIntervention *it) {
1484+ const auto disruptive = m_it.disruptive ;
14791485 if (m_it.disruptive ) {
14801486 if (m_it.url ) {
14811487 it->url = strdup (m_it.url );
1488+ } else {
1489+ it->url = NULL ;
14821490 }
14831491 it->disruptive = m_it.disruptive ;
14841492 it->status = m_it.status ;
14851493
14861494 if (m_it.log != NULL ) {
1487- std::string log (" " );
1488- log.append (m_it.log );
1489- utils::string::replaceAll (&log, std::string (" %d" ),
1495+ std::string log (m_it.log );
1496+ utils::string::replaceAll (log, " %d" ,
14901497 std::to_string (it->status ));
14911498 it->log = strdup (log.c_str ());
1499+ } else {
1500+ it->log = NULL ;
14921501 }
14931502 intervention::reset (&m_it);
14941503 }
14951504
1496- return it-> disruptive ;
1505+ return disruptive;
14971506}
14981507
14991508
@@ -2260,11 +2269,16 @@ extern "C" void msc_transaction_cleanup(Transaction *transaction) {
22602269 *
22612270 * Intervention can generate a log event and/or perform a disruptive action.
22622271 *
2263- * @param transaction ModSecurity transaction.
2272+ * If the return value is not zero, all fields in the ModSecurityIntervention
2273+ * parameter have been initialized and are safe to access.
2274+ * If the return value is zero, no changes to the ModSecurityIntervention
2275+ * parameter have been made.
22642276 *
2265- * @return Pointer to ModSecurityIntervention structure
2266- * @retval >0 A intervention should be made.
2267- * @retval NULL Nothing to be done.
2277+ * @param transaction ModSecurity transaction.
2278+ * @param it Pointer to ModSecurityIntervention structure
2279+ * @returns If an intervention should be made
2280+ * @retval >0 A intervention should be made.
2281+ * @retval 0 Nothing to be done.
22682282 *
22692283 */
22702284extern " C" int msc_intervention (Transaction *transaction,
0 commit comments