-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Increase precision to high for cpp/static-buffer-overflow #6760
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
Increase precision to high for cpp/static-buffer-overflow #6760
Conversation
… or 1 as variable sized
…e loop counter has been widened
jbj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code changes LGTM, but I've suggested some expansion of the docs.
This PR removes many good results in the tests, but I think those results were on contrived code.
cpp/ql/lib/semmle/code/cpp/rangeanalysis/SimpleRangeAnalysis.qll
Outdated
Show resolved
Hide resolved
cpp/ql/lib/semmle/code/cpp/rangeanalysis/SimpleRangeAnalysis.qll
Outdated
Show resolved
Hide resolved
Co-authored-by: Jonas Jensen <jbj@github.com>
Co-authored-by: Jonas Jensen <jbj@github.com>
|
Test fails on |
These needs to be resolved in the internal repo. You need to create a PR in the internal repo with the changes and bump the QL submodule in the PR to point to the HEAD of this PR. I'll happily go over this on a call if you want. It takes a couple of tries to get used to :) |
|
I'm around to help in the office. |
Co-authored-by: Jonas Jensen <jbj@github.com>
MathiasVP
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!


As this changes the precision on static-buffer-overflow query, please do not merge before GHES 3.3 has been branched.
This PR includes:
memberMaybeVarsizedto include all members of size 0 or 1offsetofis accessed->may be accessed)Statistics from running OverflowStatic on all LGTM projects:
[*] Unknown alerts denotes alerts, where I cannot judge if the alerts is correct. These usually includes nested macro expansions.
The false positives can be grouped into:
page_size(evaluated to 0) (1 FP)char data[sizeof(int)]) (2 FP)Detailed results and the actual analysis can be found here:
https://gist.github.com/andersfugmann/5091e7c63cd4f6ae94d3b86e426efd77