Apply suggestion: use exists(var | range | formula) idiom in OsPathBasenameCall

Agent-Logs-Url: https://github.com/github/codeql/sessions/a319e151-8e8f-4770-b87c-12b5cdb268b8

Co-authored-by: hvitved <3667920+hvitved@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-16 09:46:07 +00:00
committed by GitHub
parent 3a512ae777
commit 3229b9052e

View File

@@ -118,11 +118,10 @@ module PathInjection {
private class OsPathBasenameCall extends Sanitizer, DataFlow::CallCfgNode {
OsPathBasenameCall() {
exists(API::Node osPathModule |
(
osPathModule = API::moduleImport("os").getMember("path")
or
osPathModule = API::moduleImport(["posixpath", "ntpath", "genericpath"])
) and
osPathModule = API::moduleImport("os").getMember("path")
or
osPathModule = API::moduleImport(["posixpath", "ntpath", "genericpath"])
|
this = osPathModule.getMember("basename").getACall()
)
}