Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If a function modifies a pointed-to value, declaring this value as const will be caught by the compiler.

Code Block
bgColor#ffffcc#ffcccc
void foo(const int * x) {
  if (x != NULL) {
    *x = 3; /* generates compiler warning */
  }
  /* ... */
}

...

L3

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

EXP10-A

1 (medium)

1 (unlikely)

2 (high)

P2

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

...