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

C++: Improvements to cpp/improper-null-termination #6794

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

@geoffw0
Copy link
Contributor

@geoffw0 geoffw0 commented Oct 1, 2021

Improvements to cpp/improper-null-termination, and to a lesser extent cpp/user-controlled-null-termination-tainted.

  • added some test cases inspired by real world (LGTM) results
  • fixed a false positive involving functions that return a parameter
  • fixed a false positive involving taking the address of a variable
  • gave the two queries medium precision

The remaining FPs all seem to be related to branching flows, e.g. where a different variable indicates which branch we've been down / whether the string is initialized / null terminated or not. It's possible StackVariableReachability and TaintTracking alone won't be up to the job and the queries will need a more significant rewrite to fix this. Doing so might allow them to be increased to high precision, but they certainly aren't there yet (see https://lgtm.com/query/5264194598604498103/, https://lgtm.com/query/4764927980359278490/).

TODO:

  • check performance (that it's OK in general, more so than concerns about regression; since we're giving the query a precision tag it will be used more often)
@geoffw0 geoffw0 added the C++ label Oct 1, 2021
@geoffw0 geoffw0 requested a review from as a code owner Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant