Versions Compared

Key

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

...

Tool

Version

Checker

Description

Section

Fortify SCA

Section

V. 5.0

 

Section

can detect violations of this rule with CERT C Rule Pack, except those involving the sizeof operator

Section

Coverity Prevent

Include Page
c:Coverity_V
c:Coverity_V
Section

SIZECHECK

Section

finds memory allocations that are assigned to a pointer that reference objects larger than the allocated block

Section

Coverity Prevent

Include Page
c:Coverity_V
c:Coverity_V
Section

BAD_ALLOC_STRLEN

Section

can find the instances where string length is miscalculated (length calculated may be one less than intended) for memory allocation purposes. Coverity Prevent cannot discover all violations of this rule so further verification is necessary

Section

Compass/ROSE

 

 

Section

could check violations of this rule by examining the size expression to malloc() or memcpy() functions. Specifically, the size argument should be bounded by 0, SIZE_MAX, and, unless it is a variable of type size_t or rsize_t, it should be bounds-checked before the malloc() call. If the argument is of the expression a*b, then an appropriate check is:

Code Block
if (a < SIZE_MAX / b && a > 0) ...

...