File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
rust/ql/test/library-tests/dataflow/sources Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ module MyFlowConfig implements DataFlow::ConfigSig {
1414 .getArgList ( )
1515 .getAnArg ( ) = sink .asExpr ( ) .getExpr ( )
1616 }
17+
18+ predicate allowImplicitRead ( DataFlow:: Node node , DataFlow:: ContentSet c ) {
19+ // flow out from any content at the sink.
20+ isSink ( node ) and
21+ exists ( c )
22+ }
1723}
1824
1925module MyFlowTest = TaintFlowTest< MyFlowConfig > ;
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ fn sink<T>(_: T) { }
55// --- tests ---
66
77fn test_env_vars ( ) {
8- sink ( std:: env:: var ( "HOME" ) ) ; // $ Alert[rust/summary/taint-sources] MISSING: hasTaintFlow
9- sink ( std:: env:: var_os ( "PATH" ) ) ; // $ Alert[rust/summary/taint-sources] MISSING: hasTaintFlow
8+ sink ( std:: env:: var ( "HOME" ) ) ; // $ Alert[rust/summary/taint-sources] hasTaintFlow="HOME"
9+ sink ( std:: env:: var_os ( "PATH" ) ) ; // $ Alert[rust/summary/taint-sources] hasTaintFlow="PATH"
1010
1111 let var1 = std:: env:: var ( "HOME" ) . expect ( "HOME not set" ) ; // $ Alert[rust/summary/taint-sources]
1212 let var2 = std:: env:: var_os ( "PATH" ) . unwrap ( ) ; // $ Alert[rust/summary/taint-sources]
You can’t perform that action at this time.
0 commit comments