mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Adapted AuditLog based on code check hints
This commit is contained in:
parent
01c427f6be
commit
0f402f33fd
@ -207,7 +207,7 @@ class AuditLog {
|
|||||||
AuditLogType m_type = NotSetAuditLogType;
|
AuditLogType m_type = NotSetAuditLogType;
|
||||||
std::string m_relevant = std::string("");
|
std::string m_relevant = std::string("");
|
||||||
|
|
||||||
audit_log::writer::Writer *m_writer = NULL;
|
audit_log::writer::Writer *m_writer = nullptr;
|
||||||
bool m_ctlAuditEngineActive = false; // rules have at least one action On or RelevantOnly
|
bool m_ctlAuditEngineActive = false; // rules have at least one action On or RelevantOnly
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -51,13 +51,13 @@ namespace modsecurity {
|
|||||||
namespace audit_log {
|
namespace audit_log {
|
||||||
|
|
||||||
|
|
||||||
AuditLog::AuditLog() { }
|
AuditLog::AuditLog() = default;
|
||||||
|
|
||||||
|
|
||||||
AuditLog::~AuditLog() {
|
AuditLog::~AuditLog() {
|
||||||
if (m_writer) {
|
if (m_writer) {
|
||||||
delete m_writer;
|
delete m_writer;
|
||||||
m_writer = NULL;
|
m_writer = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ bool AuditLog::init(std::string *error) {
|
|||||||
&& !m_ctlAuditEngineActive) {
|
&& !m_ctlAuditEngineActive) {
|
||||||
if (m_writer) {
|
if (m_writer) {
|
||||||
delete m_writer;
|
delete m_writer;
|
||||||
m_writer = NULL;
|
m_writer = nullptr;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -228,7 +228,7 @@ bool AuditLog::init(std::string *error) {
|
|||||||
tmp_writer = new audit_log::writer::Serial(this);
|
tmp_writer = new audit_log::writer::Serial(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmp_writer == NULL) {
|
if (tmp_writer == nullptr) {
|
||||||
error->assign("Writer memory alloc failed!");
|
error->assign("Writer memory alloc failed!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -306,7 +306,7 @@ bool AuditLog::saveIfRelevant(Transaction *transaction, int parts) {
|
|||||||
}
|
}
|
||||||
ms_dbg_a(transaction, 5, "Saving this request as part " \
|
ms_dbg_a(transaction, 5, "Saving this request as part " \
|
||||||
"of the audit logs.");
|
"of the audit logs.");
|
||||||
if (m_writer == NULL) {
|
if (m_writer == nullptr) {
|
||||||
ms_dbg_a(transaction, 1, "Internal error, audit log writer is null");
|
ms_dbg_a(transaction, 1, "Internal error, audit log writer is null");
|
||||||
} else {
|
} else {
|
||||||
std::string error;
|
std::string error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user