Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f47a77b commit bbc8e78Copy full SHA for bbc8e78
1 file changed
cpp/ql/src/Security/CWE/CWE-676/PotentiallyDangerousFunction.ql
@@ -11,14 +11,16 @@
11
*/
12
import cpp
13
14
-
15
-predicate dangerousFunction(Function function) {
16
- exists (string name | name = function.getQualifiedName() |
17
- name = "gmtime")
+predicate potentiallyDangerousFunction(Function f, string message) {
+ (
+ f.getQualifiedName() = "gmtime" and
+ message = "Call to gmtime is potentially dangerous"
18
+ )
19
}
20
21
-from FunctionCall call, Function target
22
-where call.getTarget() = target
23
- and dangerousFunction(target)
24
-select call, "Call to " + target.getQualifiedName() + " is potentially dangerous"
+from FunctionCall call, Function target, string message
+where
+ call.getTarget() = target and
25
+ potentiallyDangerousFunction(target, message)
26
+select call, message
0 commit comments