File tree Expand file tree Collapse file tree
cpp/ql/src/semmle/code/cpp/ir/dataflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,6 +67,9 @@ private DataFlow::Node getNodeForSource(Expr source) {
6767 // to `gets`. It's impossible here to tell which is which, but the "access
6868 // to argv" source is definitely not intended to match an output argument,
6969 // and it causes false positives if we let it.
70+ //
71+ // This case goes together with the similar (but not identical) rule in
72+ // `nodeIsBarrierIn`.
7073 result = DataFlow:: definitionByReferenceNode ( source ) and
7174 not argv ( source .( VariableAccess ) .getTarget ( ) )
7275 )
@@ -179,7 +182,13 @@ private predicate nodeIsBarrier(DataFlow::Node node) {
179182
180183private predicate nodeIsBarrierIn ( DataFlow:: Node node ) {
181184 // don't use dataflow into taint sources, as this leads to duplicate results.
182- node = getNodeForSource ( any ( Expr e ) )
185+ exists ( Expr source | isUserInput ( source , _) |
186+ node = DataFlow:: exprNode ( source )
187+ or
188+ // This case goes together with the similar (but not identical) rule in
189+ // `getNodeForSource`.
190+ node = DataFlow:: definitionByReferenceNode ( source )
191+ )
183192}
184193
185194cached
You can’t perform that action at this time.
0 commit comments