Skip to content

Commit 58680c9

Browse files
committed
Rust: Repair BadCtorInitialization.ql's StdCall using getCanonicalPath.
1 parent 9d72fab commit 58680c9

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)