mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2026-01-02 06:34:44 +03:00
Makes m_uri_no_query_string_decoded a shared pointer
This commit is contained in:
@@ -110,7 +110,7 @@ class RuleMessage {
|
|||||||
bool m_saveMessage;
|
bool m_saveMessage;
|
||||||
std::shared_ptr<std::string> m_serverIpAddress;
|
std::shared_ptr<std::string> m_serverIpAddress;
|
||||||
int m_severity;
|
int m_severity;
|
||||||
std::string m_uriNoQueryStringDecoded;
|
std::shared_ptr<std::string> m_uriNoQueryStringDecoded;
|
||||||
std::string m_ver;
|
std::string m_ver;
|
||||||
|
|
||||||
std::list<std::string> m_tags;
|
std::list<std::string> m_tags;
|
||||||
|
|||||||
@@ -406,7 +406,7 @@ class Transaction : public TransactionAnchoredVariables {
|
|||||||
/**
|
/**
|
||||||
* Holds the URI that was requests (without the query string).
|
* Holds the URI that was requests (without the query string).
|
||||||
*/
|
*/
|
||||||
std::string m_uri_no_query_string_decoded;
|
std::shared_ptr<std::string> m_uri_no_query_string_decoded;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the combined size of all arguments, later used to fill the
|
* Holds the combined size of all arguments, later used to fill the
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ std::string RuleMessage::_details(const RuleMessage *rm) {
|
|||||||
}
|
}
|
||||||
msg.append(" [hostname \"" + *rm->m_serverIpAddress.get() \
|
msg.append(" [hostname \"" + *rm->m_serverIpAddress.get() \
|
||||||
+ "\"]");
|
+ "\"]");
|
||||||
msg.append(" [uri \"" + rm->m_uriNoQueryStringDecoded + "\"]");
|
msg.append(" [uri \"" + *rm->m_uriNoQueryStringDecoded.get() + "\"]");
|
||||||
msg.append(" [unique_id \"" + rm->m_id + "\"]");
|
msg.append(" [unique_id \"" + rm->m_id + "\"]");
|
||||||
msg.append(" [ref \"" + rm->m_reference + "\"]");
|
msg.append(" [ref \"" + rm->m_reference + "\"]");
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ std::string RuleMessage::_errorLogTail(const RuleMessage *rm) {
|
|||||||
std::string msg;
|
std::string msg;
|
||||||
|
|
||||||
msg.append("[hostname \"" + *rm->m_serverIpAddress.get() + "\"]");
|
msg.append("[hostname \"" + *rm->m_serverIpAddress.get() + "\"]");
|
||||||
msg.append(" [uri \"" + rm->m_uriNoQueryStringDecoded + "\"]");
|
msg.append(" [uri \"" + *rm->m_uriNoQueryStringDecoded.get() + "\"]");
|
||||||
msg.append(" [unique_id \"" + rm->m_id + "\"]");
|
msg.append(" [unique_id \"" + rm->m_id + "\"]");
|
||||||
|
|
||||||
return msg;
|
return msg;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ namespace modsecurity {
|
|||||||
Transaction::Transaction(ModSecurity *ms, RulesSet *rules, void *logCbData)
|
Transaction::Transaction(ModSecurity *ms, RulesSet *rules, void *logCbData)
|
||||||
: m_clientPort(0),
|
: m_clientPort(0),
|
||||||
m_serverPort(0),
|
m_serverPort(0),
|
||||||
m_uri_no_query_string_decoded(""),
|
m_uri_no_query_string_decoded(nullptr),
|
||||||
m_rules(rules),
|
m_rules(rules),
|
||||||
m_timeStamp(std::time(NULL)),
|
m_timeStamp(std::time(NULL)),
|
||||||
m_httpCodeReturned(200),
|
m_httpCodeReturned(200),
|
||||||
@@ -145,7 +145,7 @@ Transaction::Transaction(ModSecurity *ms, RulesSet *rules, void *logCbData)
|
|||||||
Transaction::Transaction(ModSecurity *ms, RulesSet *rules, char *id, void *logCbData)
|
Transaction::Transaction(ModSecurity *ms, RulesSet *rules, char *id, void *logCbData)
|
||||||
: m_clientPort(0),
|
: m_clientPort(0),
|
||||||
m_serverPort(0),
|
m_serverPort(0),
|
||||||
m_uri_no_query_string_decoded(""),
|
m_uri_no_query_string_decoded(nullptr),
|
||||||
m_rules(rules),
|
m_rules(rules),
|
||||||
m_timeStamp(std::time(NULL)),
|
m_timeStamp(std::time(NULL)),
|
||||||
m_httpCodeReturned(200),
|
m_httpCodeReturned(200),
|
||||||
@@ -413,9 +413,11 @@ int Transaction::processURI(const char *uri, const char *method,
|
|||||||
|
|
||||||
|
|
||||||
if (pos != std::string::npos) {
|
if (pos != std::string::npos) {
|
||||||
m_uri_no_query_string_decoded = std::string(m_uri_decoded, 0, pos);
|
m_uri_no_query_string_decoded = std::unique_ptr<std::string>(
|
||||||
|
new std::string(m_uri_decoded, 0, pos));
|
||||||
} else {
|
} else {
|
||||||
m_uri_no_query_string_decoded = std::string(m_uri_decoded);
|
m_uri_no_query_string_decoded = std::unique_ptr<std::string>(
|
||||||
|
new std::string(m_uri_decoded));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user