From 3229b9052ea12210cdfe0fc9ca3abc08d9f6b9d5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 16 Apr 2026 09:46:07 +0000 Subject: [PATCH] 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> --- .../security/dataflow/PathInjectionCustomizations.qll | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/python/ql/lib/semmle/python/security/dataflow/PathInjectionCustomizations.qll b/python/ql/lib/semmle/python/security/dataflow/PathInjectionCustomizations.qll index 023e0906002..c1e77b05e8c 100644 --- a/python/ql/lib/semmle/python/security/dataflow/PathInjectionCustomizations.qll +++ b/python/ql/lib/semmle/python/security/dataflow/PathInjectionCustomizations.qll @@ -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() ) }