Versions Compared

Key

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

...

This example checks the value of num_blocks to make sure the subsequent multiplication operation cannot result in an integer overflow. The code also ensures that num_blocks is not equal to zero (see MEM04-AC. Do not perform zero length allocations).

...

The code also ensures that len is not equal to zero (see MEM04-AC. Do not perform zero length allocations).

...