mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
CPP: Fix dubious [old] taint library results involving strlen.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user