Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ab944f3

Browse files
authored
Merge pull request #139 from geoffw0/function-wrappers
CPP: Make FunctionWithWrappers `toCause` work on builtins.
2 parents 73675e2 + d5b7ab5 commit ab944f3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ import PrintfLike
33
private import TaintTracking
44

55
private
6+
bindingset[index]
67
string toCause(Function func, int index)
78
{
8-
result = func.getQualifiedName() + "(" + func.getParameter(index).getName() + ")"
9+
result = func.getQualifiedName() + "(" + func.getParameter(index).getName() + ")" or
10+
(
11+
not exists(func.getParameter(index).getName()) and
12+
result = func.getQualifiedName() + "(arg " + index + ")"
13+
)
914
}
1015

1116
/**

0 commit comments

Comments
 (0)