mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
CPP: Extend coverage.
This commit is contained in:
@@ -12,9 +12,14 @@
|
||||
import cpp
|
||||
|
||||
predicate potentiallyDangerousFunction(Function f, string message) {
|
||||
(
|
||||
f.getQualifiedName() = "gmtime" and
|
||||
message = "Call to gmtime is potentially dangerous"
|
||||
exists(string name | name = f.getQualifiedName() |
|
||||
(
|
||||
name = "gmtime" or
|
||||
name = "localtime" or
|
||||
name = "ctime" or
|
||||
name = "asctime"
|
||||
) and
|
||||
message = "Call to " + name + " is potentially dangerous"
|
||||
) or (
|
||||
f.getQualifiedName() = "gets" and
|
||||
message = "gets does not guard against buffer overflow"
|
||||
|
||||
Reference in New Issue
Block a user