Skip to content

RULE-1-2: False positives reported for variable length arrays #701

Closed
@lcartey

Description

@lcartey

Affected rules

  • RULE-1-2

Description

This rule currently flags all variable length arrays, and arrays without a specified size, but which are initialized. However, various types of variable length arrays are permitted in C99 onwards.

Example

void example_function(int n, int x[n]) { // COMPLIANT[FALSE_POSITIVE]
  struct S {
    int x1[n]; // NON_COMPLIANT
    int x2[]; // COMPLIANT[FALSE_POSITIVE]
  };

  int y[] = {1,2,3}; // COMPLIANT[FALSE_POSITIVE]
}

Metadata

Metadata

Assignees

Labels

Difficulty-MediumA false positive or false negative report which is expected to take 1-5 days effort to addressImpact-Highfalse positive/false negativeAn issue related to observed false positives or false negatives.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions