CPP: Fix dubious [old] taint library results involving strlen.

This commit is contained in:
Geoffrey White
2019-01-30 15:55:04 +00:00
parent 8c75e730e4
commit 0b85966b31

View File

@@ -247,7 +247,11 @@ predicate insideFunctionValueMoveTo(Element src, Element dest)
// Expressions computed from tainted data are also tainted
or exists(FunctionCall call | dest = call and isPureFunction(call.getTarget().getName()) |
call.getAnArgument() = src and
forall(Expr arg | arg = call.getAnArgument() | arg = src or predictable(arg))
forall(Expr arg | arg = call.getAnArgument() | arg = src or predictable(arg)) and
// flow through `strlen` tends to cause dubious results, if the length is
// bounded.
not call.getTarget().getName() = "strlen"
)
or exists(Element a, Element b |
moveToDependingOnSide(a, b) and