mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
Add const modifier to variable
This commit is contained in:
parent
8b3269f4d1
commit
62cb73f31d
@ -228,7 +228,7 @@ 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
|
||||
const struct sockaddr *addr = info->ai_addr; // NOSONAR
|
||||
if (addr->sa_family == AF_INET) { // NOSONAR
|
||||
struct sockaddr_in sin{}; // initialize an empty struct; we don't need port info
|
||||
memcpy(&sin.sin_addr, addr->sa_data + 2, sizeof(sin.sin_addr));
|
||||
|
Loading…
x
Reference in New Issue
Block a user