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

Skip to content

Commit 0b85966

Browse files
committed
CPP: Fix dubious [old] taint library results involving strlen.
1 parent 8c75e73 commit 0b85966

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,11 @@ predicate insideFunctionValueMoveTo(Element src, Element dest)
247247
// Expressions computed from tainted data are also tainted
248248
or exists(FunctionCall call | dest = call and isPureFunction(call.getTarget().getName()) |
249249
call.getAnArgument() = src and
250-
forall(Expr arg | arg = call.getAnArgument() | arg = src or predictable(arg))
250+
forall(Expr arg | arg = call.getAnArgument() | arg = src or predictable(arg)) and
251+
252+
// flow through `strlen` tends to cause dubious results, if the length is
253+
// bounded.
254+
not call.getTarget().getName() = "strlen"
251255
)
252256
or exists(Element a, Element b |
253257
moveToDependingOnSide(a, b) and

0 commit comments

Comments
 (0)