@@ -103,9 +103,9 @@ Transaction::Transaction(ModSecurity *ms, RulesSet *rules, void *logCbData)
103103 : m_creationTimeStamp(utils::cpu_seconds()),
104104 /* m_clientIpAddress(nullptr), */
105105 m_httpVersion (" " ),
106- m_serverIpAddress(" " ),
106+ /* m_serverIpAddress(""), */
107107 m_uri(" " ),
108- m_uri_no_query_string_decoded(" " ),
108+ /* m_uri_no_query_string_decoded(""), */
109109 m_ARGScombinedSizeDouble(0 ),
110110 m_clientPort(0 ),
111111 m_highestSeverityAction(255 ),
@@ -176,9 +176,9 @@ Transaction::Transaction(ModSecurity *ms, RulesSet *rules, char *id, void *logCb
176176 : m_creationTimeStamp(utils::cpu_seconds()),
177177 /* m_clientIpAddress(""), */
178178 m_httpVersion(" " ),
179- m_serverIpAddress(" " ),
179+ /* m_serverIpAddress(""), */
180180 m_uri(" " ),
181- m_uri_no_query_string_decoded(" " ),
181+ /* m_uri_no_query_string_decoded(""), */
182182 m_ARGScombinedSizeDouble(0 ),
183183 m_clientPort(0 ),
184184 m_highestSeverityAction(255 ),
@@ -310,7 +310,7 @@ void Transaction::debug(int level, std::string message) const {
310310int Transaction::processConnection (const char *client, int cPort,
311311 const char *server, int sPort ) {
312312 m_clientIpAddress = std::unique_ptr<std::string>(new std::string (client));
313- this -> m_serverIpAddress = server;
313+ m_serverIpAddress = std::unique_ptr<std::string>( new std::string ( server)) ;
314314 this ->m_clientPort = cPort;
315315 this ->m_serverPort = sPort ;
316316 ms_dbg (4 , " Transaction context created." );
@@ -320,7 +320,7 @@ int Transaction::processConnection(const char *client, int cPort,
320320 m_variableRemoteHost.set (*m_clientIpAddress.get (), m_variableOffset);
321321 m_variableUniqueID.set (m_id, m_variableOffset);
322322 m_variableRemoteAddr.set (*m_clientIpAddress.get (), m_variableOffset);
323- m_variableServerAddr.set (m_serverIpAddress, m_variableOffset);
323+ m_variableServerAddr.set (* m_serverIpAddress. get () , m_variableOffset);
324324 m_variableServerPort.set (std::to_string (this ->m_serverPort ),
325325 m_variableOffset);
326326 m_variableRemotePort.set (std::to_string (this ->m_clientPort ),
@@ -470,9 +470,11 @@ int Transaction::processURI(const char *uri, const char *method,
470470
471471
472472 if (pos != std::string::npos) {
473- m_uri_no_query_string_decoded = std::string (m_uri_decoded, 0 , pos);
473+ m_uri_no_query_string_decoded = std::unique_ptr<std::string>(
474+ new std::string (m_uri_decoded, 0 , pos));
474475 } else {
475- m_uri_no_query_string_decoded = std::string (m_uri_decoded);
476+ m_uri_no_query_string_decoded = std::unique_ptr<std::string>(
477+ new std::string (m_uri_decoded));
476478 }
477479
478480
@@ -1523,7 +1525,7 @@ std::string Transaction::toOldAuditLogFormat(int parts,
15231525 audit_log << " " << this ->m_id .c_str ();
15241526 audit_log << " " << this ->m_clientIpAddress ;
15251527 audit_log << " " << this ->m_clientPort ;
1526- audit_log << " " << this -> m_serverIpAddress ;
1528+ audit_log << " " << m_serverIpAddress;
15271529 audit_log << " " << this ->m_serverPort ;
15281530 audit_log << std::endl;
15291531
@@ -1644,7 +1646,7 @@ std::string Transaction::toJSON(int parts) {
16441646 LOGFY_ADD (" time_stamp" , ts.c_str ());
16451647 LOGFY_ADD (" server_id" , uniqueId.c_str ());
16461648 LOGFY_ADD_NUM (" client_port" , m_clientPort);
1647- LOGFY_ADD (" host_ip" , m_serverIpAddress. c_str ());
1649+ LOGFY_ADD (" host_ip" , m_serverIpAddress-> c_str ());
16481650 LOGFY_ADD_NUM (" host_port" , m_serverPort);
16491651 LOGFY_ADD (" unique_id" , this ->m_id .c_str ());
16501652
0 commit comments