-
Notifications
You must be signed in to change notification settings - Fork 1.7k
DescriptorNeverClosed.ql identifies only sockets (not file handles) #2623
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
Comments
Thanks for pointing out this issue. The affected query is not in active use, but I'd be happy to merge a PR that updates the |
marcrepo
added a commit
to marcrepo/ql
that referenced
this issue
Jan 17, 2020
This pull request is in reference to Issue github#2623 - "DescriptorNeverClosed.ql identifies only sockets (not file handles)"
marcrepo
added a commit
to marcrepo/ql
that referenced
this issue
Jan 17, 2020
Changes based on Issue github#2623 - DescriptorNeverClosed.ql identifies only sockets (not file handles)
This was referenced Jan 17, 2020
marcrepo
added a commit
to marcrepo/ql
that referenced
this issue
Jan 17, 2020
Documentation update for Issue github#2623
Thanks. I just sent a pull request that modified the descriptions in the two files. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description of the issue
The wiki description for the DescriptorNeverClosed Library
(URL: https://help.semmle.com/wiki/display/CCPPOBJ/Open+descriptor+never+closed)
states that this library identifies both socket handles and file handles that have not been
closed. However, it appears the query only searches for socket handles that have not been closed.
In the DescriptorNeverClosed.ql file (URL: https://github.com/Semmle/ql/blob/master/cpp/ql/src/Critical/DescriptorNeverClosed.ql)
the handles being search for by the query are initially acquired with the allocateDescriptorCall predicate that appears in the where clause (line 29 of the DescriptorNeverClosed.ql file).
However, the implementation of this predicate, which is found in https://github.com/Semmle/ql/blob/3a95cd5e9c15f02208c73d3972f6283a27ca8657/cpp/ql/src/semmle/code/cpp/pointsto/PointsTo.qll
has the following implementation - which only searches for socket handles (starting line 699):
predicate allocateDescriptorCall(FunctionCall fc) {
exists(string name |
name = "socket" and
fc.getTarget().hasGlobalName(name)
)
}
The text was updated successfully, but these errors were encountered: