diff --git a/src/operators/rbl.cc b/src/operators/rbl.cc index b09933c2..22fcfcff 100644 --- a/src/operators/rbl.cc +++ b/src/operators/rbl.cc @@ -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(addr); + struct sockaddr_in *sin = (struct sockaddr_in *) addr; // cppcheck-suppress[dangerousTypeCast] furtherInfo(sin, ipStr, t, m_provider); } else { diff --git a/src/variables/xml.cc b/src/variables/xml.cc index 6a819be6..0a2d33a0 100644 --- a/src/variables/xml.cc +++ b/src/variables/xml.cc @@ -91,7 +91,7 @@ void XML::evaluate(Transaction *t, } else { std::vector acts = rule->getActionsByName("xmlns", t); for (auto &x : acts) { - actions::XmlNS *z = reinterpret_cast(x); + actions::XmlNS *z = static_cast(x); if (xmlXPathRegisterNs(xpathCtx, reinterpret_cast(z->m_scope.c_str()), reinterpret_cast(z->m_href.c_str())) != 0) { ms_dbg_a(t, 1, "Failed to register XML namespace href \"" + \