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

A7-1-2: Exclude variables in uninstantiated templates and compiler generated variables #607

Closed
lcartey opened this issue Jun 3, 2024 · 0 comments · Fixed by #608
Closed
Assignees
Labels
Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium user-report Issue reported by an end user of CodeQL Coding Standards

Comments

@lcartey
Copy link
Collaborator

lcartey commented Jun 3, 2024

Affected rules

  • A7-1-2

Description

Uninstantiated templates may not include the full set of types or call targets for function calls, which can cause false positives for this query.

Similarly, compiler generated variables cannot be addressed by the end user and should be filtered out.

Example

template <typename T> T* init(T** t) { }

template <typename T> T* init() {
 T* t = nullptr; // COMPLIANT - initialized below
 init(&t); // Init is ignored in uninitialized template
 return t;
}
@lcartey lcartey added Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium user-report Issue reported by an end user of CodeQL Coding Standards labels Jun 3, 2024
@lcartey lcartey self-assigned this Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium user-report Issue reported by an end user of CodeQL Coding Standards
Projects
1 participant