mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 21:36:00 +03:00
Removed unused overload of dash_if_empty that sonarcloud flags as potential buffer overflow
This commit is contained in:
parent
8b17f3691f
commit
cc0f893854
@ -1520,7 +1520,7 @@ std::string Transaction::toOldAuditLogFormatIndex(const std::string &filename,
|
||||
ss << utils::string::dash_if_empty(
|
||||
m_variableRequestHeaders.resolveFirst("Host").get())
|
||||
<< " ";
|
||||
ss << utils::string::dash_if_empty(this->m_clientIpAddress->c_str()) << " ";
|
||||
ss << utils::string::dash_if_empty(this->m_clientIpAddress.get()) << " ";
|
||||
/** TODO: Check variable */
|
||||
variables::RemoteUser *r = new variables::RemoteUser("REMOTE_USER");
|
||||
std::vector<const VariableValue *> l;
|
||||
@ -1531,7 +1531,7 @@ std::string Transaction::toOldAuditLogFormatIndex(const std::string &filename,
|
||||
delete r;
|
||||
|
||||
ss << utils::string::dash_if_empty(
|
||||
m_variableRemoteUser.c_str());
|
||||
&m_variableRemoteUser);
|
||||
ss << " ";
|
||||
/** TODO: Check variable */
|
||||
//ss << utils::string::dash_if_empty(
|
||||
|
@ -75,15 +75,6 @@ inline std::string dash_if_empty(const std::string *str) {
|
||||
}
|
||||
|
||||
|
||||
inline std::string dash_if_empty(const char *str) {
|
||||
if (str == NULL || std::strlen(str) == 0) {
|
||||
return "-";
|
||||
}
|
||||
|
||||
return std::string(str);
|
||||
}
|
||||
|
||||
|
||||
inline std::string limitTo(int amount, const std::string &str) {
|
||||
std::string ret;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user