Merge branch 'main' into port-weak-crypto-algorithm

This commit is contained in:
Rasmus Wriedt Larsen
2021-05-18 14:04:18 +02:00
638 changed files with 28708 additions and 6350 deletions

View File

@@ -16,3 +16,24 @@ builtins.open(file="filepath") # $getAPathArgument="filepath"
io.open("filepath") # $getAPathArgument="filepath"
io.open(file="filepath") # $getAPathArgument="filepath"
from pathlib import Path, PosixPath, WindowsPath
p = Path("filepath")
posix = PosixPath("posix/filepath")
windows = WindowsPath("windows/filepath")
p.chmod(0o777) # $getAPathArgument=p
posix.chmod(0o777) # $getAPathArgument=posix
windows.chmod(0o777) # $getAPathArgument=windows
with p.open() as f: # $getAPathArgument=p
f.read()
p.write_bytes(b"hello") # $getAPathArgument=p
name = windows.parent.name
o(name) # $getAPathArgument=name
wb = p.write_bytes
wb(b"hello") # $getAPathArgument=p

View File

@@ -3,6 +3,6 @@ s = "taintedString"
if s.startswith("tainted"): # $checks=s branch=true
pass
sw = s.startswith # $ MISSING: checks=s branch=true
if sw("safe"):
sw = s.startswith
if sw("safe"): # $ MISSING: checks=s branch=true
pass