Skip to content

Commit 942a980

Browse files
committed
Rust: Update PoemHandlerParam from getResolvedPath -> getCanonicalPath.
1 parent a702f7a commit 942a980

File tree

1 file changed

+7
-4
lines changed
  • rust/ql/lib/codeql/rust/frameworks

1 file changed

+7
-4
lines changed

rust/ql/lib/codeql/rust/frameworks/Poem.qll

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@
55
private import rust
66
private import codeql.rust.Concepts
77
private import codeql.rust.dataflow.DataFlow
8+
private import codeql.rust.internal.TypeInference
9+
private import codeql.rust.internal.Type
810

911
/**
1012
* Parameters of a handler function
1113
*/
1214
private class PoemHandlerParam extends RemoteSource::Range {
1315
PoemHandlerParam() {
14-
exists(TupleStructPat param |
15-
param.getResolvedPath() = ["crate::web::query::Query", "crate::web::path::Path"]
16-
|
17-
this.asPat().getPat() = param.getAField()
16+
exists(TupleStructPat param, Type t |
17+
this.asPat().getPat() = param.getAField() and
18+
t = inferType(param) and
19+
t.(StructType).asItemNode().(Addressable).getCanonicalPath() =
20+
["poem::web::query::Query", "poem::web::path::Path"]
1821
)
1922
}
2023
}

0 commit comments

Comments
 (0)