diff --git a/headers/modsecurity/transaction.h b/headers/modsecurity/transaction.h index 94f75d2a..2851f3ce 100644 --- a/headers/modsecurity/transaction.h +++ b/headers/modsecurity/transaction.h @@ -354,7 +354,7 @@ class Transaction : public TransactionAnchoredVariables { /** * Holds the HTTP version: 1.2, 2.0, 3.0 and so on.... */ - const char *m_httpVersion; + std::string m_httpVersion; /** * Holds the server IP Address @@ -364,7 +364,7 @@ class Transaction : public TransactionAnchoredVariables { /** * Holds the raw URI that was requested. */ - const char *m_uri; + std::string m_uri; /** * Holds the URI that was requests (without the query string). diff --git a/src/transaction.cc b/src/transaction.cc index 883360dd..54e459f0 100644 --- a/src/transaction.cc +++ b/src/transaction.cc @@ -1585,8 +1585,8 @@ std::string Transaction::toJSON(int parts) { utils::string::dash_if_empty( m_variableRequestMethod.evaluate()).c_str()); - LOGFY_ADD_INT("http_version", m_httpVersion); - LOGFY_ADD("uri", this->m_uri); + LOGFY_ADD_INT("http_version", m_httpVersion.c_str()); + LOGFY_ADD("uri", this->m_uri.c_str()); if (parts & audit_log::AuditLog::CAuditLogPart) { // FIXME: check for the binary content size.