Skip to content

Commit b7730fb

Browse files
committed
C++: QLDoc PrintfLike.qll.
1 parent d526a10 commit b7730fb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cpp/ql/src/semmle/code/cpp/security/PrintfLike.qll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
19
import semmle.code.cpp.commons.Printf
210
import external.ExternalArtifact
311

12+
/**
13+
* Holds if `func` is a `printf`-like formatting function and `formatArg` is
14+
* the index of the format string argument.
15+
*/
416
predicate printfLikeFunction(Function func, int formatArg) {
517
formatArg = func.(FormattingFunction).getFormatParameterIndex() and
618
not func instanceof UserDefinedFormattingFunction

0 commit comments

Comments
 (0)