Skip to content

Commit 0102322

Browse files
committed
C++: QLDoc FunctionWithWrappers.qll.
1 parent a8a7df4 commit 0102322

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/**
2+
* Provides predicates for identifying functions which wrap other functions,
3+
* passing the same arguments from the outer call into the inner call. In the
4+
* following example `MyMalloc` wraps a call to `malloc`, passing in the `size`
5+
* parameter:
6+
* ```
7+
* void *MyMalloc(size_t size)
8+
* {
9+
* void *ptr = malloc(size);
10+
*
11+
* // ... additional logic?
12+
*
13+
* return ptr;
14+
* }
15+
* ```
16+
*/
17+
118
import cpp
219
import PrintfLike
320
private import TaintTracking
@@ -152,6 +169,9 @@ abstract class FunctionWithWrappers extends Function {
152169
}
153170
}
154171

172+
/**
173+
* A `printf`-like formatting function.
174+
*/
155175
class PrintfLikeFunction extends FunctionWithWrappers {
156176
PrintfLikeFunction() { printfLikeFunction(this, _) }
157177

0 commit comments

Comments
 (0)