Versions Compared

Key

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

...

Failure to properly specify the size of a variable length array may allow arbitrary code execution or result in stack exhaustion.

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

ARR32-C

High

Probable

High

P6

L2

Automated Detection

Tool

Version

Checker

Description

Coverity
Include Page
Coverity_V
Coverity_V
REVERSE_NEGATIVEFully implemented
LDRA tool suite
 
Include Page
LDRA_V
LDRA_V
621 SEnhanced enforcement
Polyspace Bug FinderR2016a

Memory allocated with tainted size

Tainted size of variable length array

Size of the variable-length array (VLA) is from an unsecure source and may be zero, negative, or too large

PRQA QA-C
Include Page
PRQA QA-C_v
PRQA QA-C_v
1051Partially implemented
Cppcheck
Include Page
Cppcheck_V
Cppcheck_V
negativeArraySize

Context sensitive analysis
Will warn only if given size is negative

Related Vulnerabilities

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

...

Key here (explains table format and definitions)

Taxonomy

Taxonomy item

Relationship

CERT C Secure Coding StandardINT01-C. Use rsize_t or size_t for all integer values representing the size of an objectPrior to 2018-01-12: CERT: Unspecified Relationship
ISO/IEC TR 24772:2013Unchecked Array Indexing [XYZ]Prior to 2018-01-12: CERT: Unspecified Relationship
ISO/IEC TS 17961:2013Tainted, potentially mutilated, or out-of-domain integer values are used in a restricted sink [taintsink]Prior to 2018-01-12: CERT: Unspecified Relationship
CWE 2.11CWE-7582017-06-29: CERT: Rule subset of CWE

CERT-CWE Mapping Notes

Key here for mapping notes

...

  • ARR32-C is not about providing a valid buffer but reading/writing outside it. It is about providing an invalid buffer, or one that exhausts the stack.


Bibliography

...


...