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

Jb1/improper array index #58

Merged
merged 3 commits into from
Apr 18, 2024
Merged

Jb1/improper array index #58

merged 3 commits into from
Apr 18, 2024

Conversation

ropwareJB
Copy link

Query
cpp/unclear-array-index-validation

Description
Filter out DataFlow nodes which occur in ~/\/tests?\// directories.

predicate isSource(DataFlow::Node source) { isFlowSource(source, _) }
predicate isSource(DataFlow::Node source) {
isFlowSource(source, _) and
not source.getLocation().getFile().getRelativePath().regexpMatch("(.*/)?tests?/.*")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not have other ways of doing this (like some kind of filtering from Liquid post sarif generation)? If not, that's kind of crazy because we would need to add something like this to all of our queries, right? Or am I missing something

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and usually we wouldn't make such a change and just use the post-analysis finding filtering, however if a CodeQL rule generates over 2GB of data for an individual rule, the CLI will throw an exception and not complete and we are seeing instances of this. More detail in DM.

@ropwareJB ropwareJB merged commit 20033b9 into main Apr 18, 2024
2 checks passed
@ropwareJB ropwareJB deleted the jb1/improper-array-index branch April 18, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants