Skip to content

Commit 0ed1618

Browse files
committed
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".
1 parent b8f8ed5 commit 0ed1618

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/ql/src/Security/CWE/CWE-676/PotentiallyDangerousFunction.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ predicate potentiallyDangerousFunction(Function f, string message) {
1616
f.getQualifiedName() = "gmtime" and
1717
message = "Call to gmtime is potentially dangerous"
1818
) or (
19-
f.hasName("gets") and
19+
f.getQualifiedName() = "gets" and
2020
message = "gets does not guard against buffer overflow"
2121
)
2222
}

0 commit comments

Comments
 (0)