C++: Refactor ExecTainted.ql to need concatenation

This makes ExecTainted report results only when the tainted value does
not become the start of the string which is eventually run as a shell
command. The theory is that those cases are likely to be deliberate, and
part of the expected threat model of the program (e.g. $CC in make).
This lines up better with the results I considered fixable true
positives in LGTM testing
This commit is contained in:
Robert Marsh
2021-06-30 22:09:34 +00:00
committed by Robert Marsh
parent 8f4df8603a
commit 6f408f949c
4 changed files with 509 additions and 11 deletions

View File

@@ -253,6 +253,13 @@ class FormattingFunctionCall extends Expr {
// format arguments must be known
exists(getTarget().(FormattingFunction).getFirstFormatArgumentIndex())
}
/**
*
*/
Expr getOutputArgument(boolean isStream) {
result = this.(Call).getArgument(this.(Call).getTarget().(FormattingFunction).getOutputParameterIndex(isStream))
}
}
/**