File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
cpp/ql/src/semmle/code/cpp/ir/dataflow Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,14 @@ private DataFlow::Node getNodeForSource(Expr source) {
60
60
(
61
61
result = DataFlow:: exprNode ( source )
62
62
or
63
- result = DataFlow:: definitionByReferenceNode ( source )
63
+ // Some of the sources in `isUserInput` are intended to match the value of
64
+ // an expression, while others (those modeled below) are intended to match
65
+ // the taint that propagates out of an argument, like the `char *` argument
66
+ // to `gets`. It's impossible here to tell which is which, but the "access
67
+ // to argv" source is definitely not intended to match an output argument,
68
+ // and it causes false positives if we let it.
69
+ result = DataFlow:: definitionByReferenceNode ( source ) and
70
+ not argv ( source .( VariableAccess ) .getTarget ( ) )
64
71
)
65
72
}
66
73
You can’t perform that action at this time.
0 commit comments