mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 13:26:01 +03:00
Change cast type (fix SonarCloud issues)
This commit is contained in:
parent
47bc24a808
commit
9fea1ca454
@ -226,9 +226,12 @@ bool Rbl::evaluate(Transaction *t, RuleWithActions *rule,
|
||||
return false;
|
||||
}
|
||||
|
||||
// NOSONAR
|
||||
// SonarCloud suggested to use the init-statement to declare "addr" inside the if statement.
|
||||
// I think that's not good here, because we need that in the else block
|
||||
struct sockaddr *addr = info->ai_addr;
|
||||
if (addr->sa_family == AF_INET) { // only IPv4 address is allowed
|
||||
struct sockaddr_in *sin = reinterpret_cast<struct sockaddr_in *>(addr);
|
||||
struct sockaddr_in *sin = (struct sockaddr_in *) addr; // cppcheck-suppress[dangerousTypeCast]
|
||||
furtherInfo(sin, ipStr, t, m_provider);
|
||||
}
|
||||
else {
|
||||
|
@ -91,7 +91,7 @@ void XML::evaluate(Transaction *t,
|
||||
} else {
|
||||
std::vector<actions::Action *> acts = rule->getActionsByName("xmlns", t);
|
||||
for (auto &x : acts) {
|
||||
actions::XmlNS *z = reinterpret_cast<actions::XmlNS *>(x);
|
||||
actions::XmlNS *z = static_cast<actions::XmlNS *>(x);
|
||||
if (xmlXPathRegisterNs(xpathCtx, reinterpret_cast<const xmlChar*>(z->m_scope.c_str()),
|
||||
reinterpret_cast<const xmlChar*>(z->m_href.c_str())) != 0) {
|
||||
ms_dbg_a(t, 1, "Failed to register XML namespace href \"" + \
|
||||
|
Loading…
x
Reference in New Issue
Block a user