Skip to content

Commit d999ada

Browse files
committed
FunctionsWithWrappers: Simplify/tidy library.
1 parent 031964e commit d999ada

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,14 @@ abstract class FunctionWithWrappers extends Function {
139139
*/
140140
predicate outermostWrapperFunctionCall(Expr arg, string callChain)
141141
{
142-
exists(Function func, Call call, int argIndex |
143-
func = resolveCall(call)
144-
and this.wrapperFunction(func, argIndex, callChain)
145-
and not wrapperFunctionStep(call.getEnclosingFunction(), _, func, argIndex)
142+
exists(Function targetFunc, Call call, int argIndex |
143+
targetFunc = resolveCall(call)
144+
and this.wrapperFunction(targetFunc, argIndex, callChain)
145+
and (
146+
exists(Function sourceFunc | sourceFunc = call.getEnclosingFunction() |
147+
not wrapperFunctionStep(sourceFunc, _, targetFunc, argIndex)
148+
) or not exists(call.getEnclosingFunction())
149+
)
146150
and arg = call.getArgument(argIndex)
147151
)
148152
}

0 commit comments

Comments
 (0)