From 14b2bd77a06c432b403ad282754b4b75781a88c3 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Tue, 22 Jan 2019 15:36:33 -0300 Subject: [PATCH] Makes m_uri_no_query_string_decoded a shared pointer --- headers/modsecurity/rule_message.h | 2 +- headers/modsecurity/transaction.h | 2 +- src/rule_message.cc | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/headers/modsecurity/rule_message.h b/headers/modsecurity/rule_message.h index 1d186d50..f86df667 100644 --- a/headers/modsecurity/rule_message.h +++ b/headers/modsecurity/rule_message.h @@ -110,7 +110,7 @@ class RuleMessage { bool m_saveMessage; std::shared_ptr m_serverIpAddress; int m_severity; - std::string m_uriNoQueryStringDecoded; + std::shared_ptr m_uriNoQueryStringDecoded; std::string m_ver; std::list m_tags; diff --git a/headers/modsecurity/transaction.h b/headers/modsecurity/transaction.h index 5a533cda..3773957e 100644 --- a/headers/modsecurity/transaction.h +++ b/headers/modsecurity/transaction.h @@ -410,7 +410,7 @@ class Transaction : public TransactionAnchoredVariables { /** * Holds the URI that was requests (without the query string). */ - std::string m_uri_no_query_string_decoded; + std::shared_ptr m_uri_no_query_string_decoded; /** * Holds the combined size of all arguments, later used to fill the diff --git a/src/rule_message.cc b/src/rule_message.cc index ec021e6a..e19f4b49 100644 --- a/src/rule_message.cc +++ b/src/rule_message.cc @@ -42,7 +42,7 @@ std::string RuleMessage::_details(const RuleMessage *rm) { } msg.append(" [hostname \"" + *rm->m_serverIpAddress.get() \ + "\"]"); - msg.append(" [uri \"" + utils::string::limitTo(200, rm->m_uriNoQueryStringDecoded) + "\"]"); + msg.append(" [uri \"" + utils::string::limitTo(200, *rm->m_uriNoQueryStringDecoded.get()) + "\"]"); msg.append(" [unique_id \"" + rm->m_id + "\"]"); msg.append(" [ref \"" + utils::string::limitTo(200, rm->m_reference) + "\"]"); @@ -54,7 +54,7 @@ std::string RuleMessage::_errorLogTail(const RuleMessage *rm) { std::string msg; msg.append("[hostname \"" + *rm->m_serverIpAddress.get() + "\"]"); - msg.append(" [uri \"" + utils::string::limitTo(200, rm->m_uriNoQueryStringDecoded) + "\"]"); + msg.append(" [uri \"" + utils::string::limitTo(200, *rm->m_uriNoQueryStringDecoded.get()) + "\"]"); msg.append(" [unique_id \"" + rm->m_id + "\"]"); return msg;