C++: Use getQualifiedName() = "gets", not hasName

This fixes false positives on
https://lgtm.com/projects/g/brandonpelfrey/Construct caused by a member
function named `gets` -- probably short for "get s".
This commit is contained in:
Jonas Jensen
2019-03-04 08:56:34 +01:00
parent b8f8ed55e6
commit 0ed1618824

View File

@@ -16,7 +16,7 @@ predicate potentiallyDangerousFunction(Function f, string message) {
f.getQualifiedName() = "gmtime" and
message = "Call to gmtime is potentially dangerous"
) or (
f.hasName("gets") and
f.getQualifiedName() = "gets" and
message = "gets does not guard against buffer overflow"
)
}