Versions Compared

Key

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

...

Code Block
bgColor#ccccff
langc
enum { MAX_ARRAY = 1024 };

void func(size_t size) {
  if (0 < size && size < MAX_ARRAY) {
    int vla[size];
    /* ... */
  } else {
    /* Use dynamic allocation. */
  }
}

Implementation Details

...

Tool

Version

Checker

Description

Coverity6.5REVERSE_NEGATIVEFully Implemented
PRQA QA-C
Include Page
PRQA_V
PRQA_V
1051Partially implemented

...

CERT C Secure Coding StandardINT01-C. Use rsize_t or size_t for all integer values representing the size of an object
ISO/IEC TR 24772:2013Unchecked Array Indexing [XYZ]
ISO/IEC TS 17961 (Draft)Tainted, potentially mutilated, or out-of-domain integer values are used in a restricted sink [taintsink]

Bibliography

[ISO/IEC 9899:2011]Annex J, J.2, "Undefined behavior" 
[Griffiths 2006] 

...