Versions Compared

Key

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

...

Code Block
bgColor#FFCCCC
int *p;
*p++;

Compliant Solution 2

Dereferencing p has no effect and Correcting this example depends on the programmers intent. For instance, if dereferencing p was done on accident, then p should not be dereferenced.

Code Block
bgColor#ccccff
int *p;
p++;

If incrementing the value referred to by p was the intent, then parentheses can be used to ensure p is dereferenced then incremented EXP00-A..

Code Block
bgColor#ccccff

int *p;
(*p)++

Risk Assessment

The presence of code that has no effect could indicate logic errors that may result in unexpected behavior and vulnerabilities.

...