mirror of
https://github.com/github/codeql.git
synced 2026-05-13 18:59:27 +02:00
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:
committed by
Robert Marsh
parent
8f4df8603a
commit
6f408f949c
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user