mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Python: Add concept tests
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
open("filepath") # $getAPathArgument="filepath"
|
||||
open(file="filepath") # $getAPathArgument="filepath"
|
||||
|
||||
o = open
|
||||
|
||||
o("filepath") # f-:$getAPathArgument="filepath"
|
||||
o(file="filepath") # f-:$getAPathArgument="filepath"
|
||||
@@ -0,0 +1,19 @@
|
||||
import os.path
|
||||
|
||||
path = "un\\normalized/path"
|
||||
|
||||
p1 = os.path.normpath(path) # $pathNormalization
|
||||
p2 = os.path.normpath(path=path) # $pathNormalization
|
||||
|
||||
np = os.path.normpath
|
||||
|
||||
p3 = np(path) # $pathNormalization
|
||||
p4 = np(path=path) # $pathNormalization
|
||||
|
||||
|
||||
def normalize(path):
|
||||
return os.path.normpath(path) # $pathNormalization
|
||||
|
||||
|
||||
p5 = normalize(path)
|
||||
p6 = normalize(path=path)
|
||||
@@ -0,0 +1,4 @@
|
||||
s = "taintedString"
|
||||
|
||||
if s.startswith("tainted"): # $checks=s $branch=true
|
||||
pass
|
||||
Reference in New Issue
Block a user