Skip to content

Commit 04014d9

Browse files
authored
Merge pull request #20150 from geoffw0/ctorinit
Rust: Update BadCtorInitialization.ql to use getCanonicalPath.
2 parents ccfcd90 + 58680c9 commit 04014d9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

rust/ql/src/queries/security/CWE-696/BadCtorInitialization.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ class CtorAttr extends Attr {
3232
*/
3333
class StdCall extends Expr {
3434
StdCall() {
35-
this.(CallExpr).getFunction().(PathExpr).getResolvedCrateOrigin() = "lang:std" or
36-
this.(MethodCallExpr).getResolvedCrateOrigin() = "lang:std"
35+
this.(CallExprBase).getStaticTarget().getCanonicalPath().matches(["std::%", "<std::%"])
3736
}
3837
}
3938

0 commit comments

Comments
 (0)