Merge pull request #19804 from geoffw0/dotdot

Rust: Update DotDotCheck to use getCanonicalPath
This commit is contained in:
Geoffrey White
2025-07-25 15:50:29 +01:00
committed by GitHub

View File

@@ -69,7 +69,8 @@ module SanitizerGuard {
*/
private class DotDotCheck extends SanitizerGuard::Range, CfgNodes::MethodCallExprCfgNode {
DotDotCheck() {
this.getAstNode().(Resolvable).getResolvedPath() = "<str>::contains" and
this.getAstNode().(CallExprBase).getStaticTarget().(Addressable).getCanonicalPath() =
["<alloc::string::String>::contains", "<core::str>::contains"] and
this.getArgument(0).getAstNode().(LiteralExpr).getTextValue() =
["\"..\"", "\"../\"", "\"..\\\""]
}