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#ffcccc#ffffcc
void foo(const int * x) {
  if (x != NULL) {
    *x = 3; /* generates compiler warning */
  }
  /* ... */
}

...

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

EXP10-A

medium

unlikely

high

P2

L3

Related Vulnerabilities

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

...