C++: Taint from FormattingFunction varargs.

This commit is contained in:
Geoffrey White
2020-01-28 14:04:53 +00:00
parent 8b215c155e
commit d66f608d41
5 changed files with 41 additions and 9 deletions

View File

@@ -154,7 +154,13 @@ abstract class FormattingFunction extends ArrayFunction, TaintFunction {
override predicate hasArrayOutput(int bufParam) { bufParam = getOutputParameterIndex() }
override predicate hasTaintFlow(FunctionInput input, FunctionOutput output) {
input.isParameterDeref(getFormatParameterIndex()) and
output.isParameterDeref(getOutputParameterIndex())
exists(int arg |
(
arg = getFormatParameterIndex() or
arg >= getFirstFormatArgumentIndex()
) and
input.isParameterDeref(arg) and
output.isParameterDeref(getOutputParameterIndex())
)
}
}