-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C++: Fix FPs in cpp/overflow-buffer
#18615
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
Conversation
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.
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
cpp/ql/src/change-notes/2025-01-28-overflow-buffer.md:2
- [nitpick] The category name 'minorAnalysis' could be clearer or more standardized. Consider using a recognized category name or a more descriptive identifier.
category: minorAnalysis
Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more
geoffw0
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.
Change LGTM.
cpp/ql/test/query-tests/Security/CWE/CWE-119/semmle/tests/tests.cpp
Outdated
Show resolved
Hide resolved
…s.cpp Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
Consider this snippet:
The
cpp/overflow-bufferquery flags this up claiming that we overrun the bufferb(of size 8) because thememsetmay access 16 bytes starting at the address&b. However, this access is fine, and this is just a fancy way of zero'ingbandc.This PR fixes this by modifying the initial size deduced from
&bso that it correctly reflects that it's fine to access 16 bytes starting at this address.Commit-by-commit review encouraged.
While DCA appears uneventful, this appears to solve quite a few FPs at Microsoft 🎉