Add extra SonarCloud supression msg; Change type to auto

This commit is contained in:
Ervin Hegedus 2025-08-11 23:05:32 +02:00
parent 9fea1ca454
commit e879711d87
No known key found for this signature in database
GPG Key ID: 5FA5BC3F5EC41F61

View File

@ -230,8 +230,9 @@ bool Rbl::evaluate(Transaction *t, RuleWithActions *rule,
// 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;
// NOSONAR
if (addr->sa_family == AF_INET) { // only IPv4 address is allowed
struct sockaddr_in *sin = (struct sockaddr_in *) addr; // cppcheck-suppress[dangerousTypeCast]
auto sin = (struct sockaddr_in *) addr; // cppcheck-suppress[dangerousTypeCast]
furtherInfo(sin, ipStr, t, m_provider);
}
else {