@@ -103,9 +103,9 @@ Transaction::Transaction(ModSecurity *ms, RulesSet *rules, void *logCbData)
103
103
: m_creationTimeStamp(utils::cpu_seconds()),
104
104
/* m_clientIpAddress(nullptr), */
105
105
m_httpVersion (" " ),
106
- m_serverIpAddress(" " ),
106
+ /* m_serverIpAddress(""), */
107
107
m_uri(" " ),
108
- m_uri_no_query_string_decoded(" " ),
108
+ /* m_uri_no_query_string_decoded(""), */
109
109
m_ARGScombinedSizeDouble(0 ),
110
110
m_clientPort(0 ),
111
111
m_highestSeverityAction(255 ),
@@ -176,9 +176,9 @@ Transaction::Transaction(ModSecurity *ms, RulesSet *rules, char *id, void *logCb
176
176
: m_creationTimeStamp(utils::cpu_seconds()),
177
177
/* m_clientIpAddress(""), */
178
178
m_httpVersion(" " ),
179
- m_serverIpAddress(" " ),
179
+ /* m_serverIpAddress(""), */
180
180
m_uri(" " ),
181
- m_uri_no_query_string_decoded(" " ),
181
+ /* m_uri_no_query_string_decoded(""), */
182
182
m_ARGScombinedSizeDouble(0 ),
183
183
m_clientPort(0 ),
184
184
m_highestSeverityAction(255 ),
@@ -310,7 +310,7 @@ void Transaction::debug(int level, std::string message) const {
310
310
int Transaction::processConnection (const char *client, int cPort,
311
311
const char *server, int sPort ) {
312
312
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)) ;
314
314
this ->m_clientPort = cPort;
315
315
this ->m_serverPort = sPort ;
316
316
ms_dbg (4 , " Transaction context created." );
@@ -320,7 +320,7 @@ int Transaction::processConnection(const char *client, int cPort,
320
320
m_variableRemoteHost.set (*m_clientIpAddress.get (), m_variableOffset);
321
321
m_variableUniqueID.set (m_id, m_variableOffset);
322
322
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);
324
324
m_variableServerPort.set (std::to_string (this ->m_serverPort ),
325
325
m_variableOffset);
326
326
m_variableRemotePort.set (std::to_string (this ->m_clientPort ),
@@ -470,9 +470,11 @@ int Transaction::processURI(const char *uri, const char *method,
470
470
471
471
472
472
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));
474
475
} 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));
476
478
}
477
479
478
480
@@ -1523,7 +1525,7 @@ std::string Transaction::toOldAuditLogFormat(int parts,
1523
1525
audit_log << " " << this ->m_id .c_str ();
1524
1526
audit_log << " " << this ->m_clientIpAddress ;
1525
1527
audit_log << " " << this ->m_clientPort ;
1526
- audit_log << " " << this -> m_serverIpAddress ;
1528
+ audit_log << " " << m_serverIpAddress;
1527
1529
audit_log << " " << this ->m_serverPort ;
1528
1530
audit_log << std::endl;
1529
1531
@@ -1644,7 +1646,7 @@ std::string Transaction::toJSON(int parts) {
1644
1646
LOGFY_ADD (" time_stamp" , ts.c_str ());
1645
1647
LOGFY_ADD (" server_id" , uniqueId.c_str ());
1646
1648
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 ());
1648
1650
LOGFY_ADD_NUM (" host_port" , m_serverPort);
1649
1651
LOGFY_ADD (" unique_id" , this ->m_id .c_str ());
1650
1652
0 commit comments