Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lcartey opened this issue Sep 19, 2024 · 0 comments · May be fixed by #703
Open

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

lcartey opened this issue Sep 19, 2024 · 0 comments · May be fixed by #703
Assignees
Labels
Difficulty-Medium A false positive or false negative report which is expected to take 1-5 days effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-High

Comments

@lcartey
Copy link
Collaborator

lcartey commented Sep 19, 2024

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]
}
@lcartey lcartey added Difficulty-Medium A false positive or false negative report which is expected to take 1-5 days effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-High labels Sep 19, 2024
@lcartey lcartey self-assigned this Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty-Medium A false positive or false negative report which is expected to take 1-5 days effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-High
Projects
Status: Ready for review
1 participant