Skip to content

Commit b78d51e

Browse files
committed
Rust: Fix a bug in InlineFlow.ql that was excluding some sinks.
1 parent a5e1702 commit b78d51e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

rust/ql/test/library-tests/dataflow/sources/InlineFlow.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module MyFlowConfig implements DataFlow::ConfigSig {
1010
predicate isSource(DataFlow::Node source) { source instanceof ThreatModelSource }
1111

1212
predicate isSink(DataFlow::Node sink) {
13-
any(CallExpr call | call.getFunction().(PathExpr).getResolvedPath() = "crate::test::sink")
13+
any(CallExpr call | call.getFunction().(PathExpr).getResolvedPath().matches("%::sink"))
1414
.getArgList()
1515
.getAnArg() = sink.asExpr().getExpr()
1616
}

rust/ql/test/library-tests/dataflow/sources/web_frameworks.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ mod poem_test {
1010

1111
#[handler]
1212
fn my_poem_handler_1(Path(a): Path<String>) -> String { // $ Alert[rust/summary/taint-sources]
13-
sink(a.as_str()); // $ MISSING: hasTaintFlow
14-
sink(a.as_bytes()); // $ MISSING: hasTaintFlow
15-
sink(a); // $ MISSING: hasTaintFlow
13+
sink(a.as_str()); // $ hasTaintFlow
14+
sink(a.as_bytes()); // $ hasTaintFlow
15+
sink(a); // $ hasTaintFlow
1616

1717
"".to_string()
1818
}
@@ -59,7 +59,7 @@ mod poem_test {
5959
fn my_poem_handler_6(
6060
Query(a): Query<String>, // $ Alert[rust/summary/taint-sources]
6161
) -> String {
62-
sink(a); // $ MISSING: hasTaintFlow
62+
sink(a); // $ hasTaintFlow
6363

6464
"".to_string()
6565
}

0 commit comments

Comments
 (0)