@@ -1469,31 +1469,40 @@ int Transaction::processLogging() {
1469
1469
* @brief Check if ModSecurity has anything to ask to the server.
1470
1470
*
1471
1471
* 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.
1472
1477
*
1473
- * @param Pointer ModSecurityIntervention structure
1478
+ * @param it Pointer to ModSecurityIntervention structure
1474
1479
* @retval true A intervention should be made.
1475
1480
* @retval false Nothing to be done.
1476
1481
*
1477
1482
*/
1478
1483
bool Transaction::intervention (ModSecurityIntervention *it) {
1484
+ const auto disruptive = m_it.disruptive ;
1479
1485
if (m_it.disruptive ) {
1480
1486
if (m_it.url ) {
1481
1487
it->url = strdup (m_it.url );
1488
+ } else {
1489
+ it->url = NULL ;
1482
1490
}
1483
1491
it->disruptive = m_it.disruptive ;
1484
1492
it->status = m_it.status ;
1485
1493
1486
1494
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" ,
1490
1497
std::to_string (it->status ));
1491
1498
it->log = strdup (log .c_str ());
1499
+ } else {
1500
+ it->log = NULL ;
1492
1501
}
1493
1502
intervention::reset (&m_it);
1494
1503
}
1495
1504
1496
- return it-> disruptive ;
1505
+ return disruptive;
1497
1506
}
1498
1507
1499
1508
@@ -2260,11 +2269,16 @@ extern "C" void msc_transaction_cleanup(Transaction *transaction) {
2260
2269
*
2261
2270
* Intervention can generate a log event and/or perform a disruptive action.
2262
2271
*
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.
2264
2276
*
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.
2268
2282
*
2269
2283
*/
2270
2284
extern " C" int msc_intervention (Transaction *transaction,
0 commit comments