We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d526a10 commit b7730fbCopy full SHA for b7730fb
cpp/ql/src/semmle/code/cpp/security/PrintfLike.qll
@@ -1,6 +1,18 @@
1
+/**
2
+ * Provides a predicate for identifying formatting functions like `printf`.
3
+ *
4
+ * Consider using the newer model in
5
+ * `semmle.code.cpp.models.interfaces.FormattingFunction` directly instead of
6
+ * this library.
7
+ */
8
+
9
import semmle.code.cpp.commons.Printf
10
import external.ExternalArtifact
11
12
13
+ * Holds if `func` is a `printf`-like formatting function and `formatArg` is
14
+ * the index of the format string argument.
15
16
predicate printfLikeFunction(Function func, int formatArg) {
17
formatArg = func.(FormattingFunction).getFormatParameterIndex() and
18
not func instanceof UserDefinedFormattingFunction
0 commit comments