Call to System.IO.Path.Combine¶
ID: cs/path-combineKind: problemSecurity severity: Severity: recommendationPrecision: very-highTags: - quality - reliability - correctnessQuery suites: - csharp-security-and-quality.qls
Click to see the query in the CodeQL repository
Path.Combine may silently drop its earlier arguments if its later arguments are absolute paths. E.g.Path.Combine("C:\\Users\\Me\\Documents","C:\\ProgramFiles\\")=="C:\\ProgramFiles".
Recommendation¶
UsePath.Join instead.
References¶
Microsoft Learn, .NET API browser,Path.Combine.
Microsoft Learn, .NET API browser,Path.Join.