Python: Update a few examples so queries work on them · github/codeql@dc5bb4f · GitHub
Skip to content

Commit dc5bb4f

Browse files
committed
Python: Update a few examples so queries work on them
Fixes problem highlighted in #12156
1 parent f680838 commit dc5bb4f

3 files changed

Lines changed: 19 additions & 25 deletions

File tree

Lines changed: 15 additions & 21 deletions
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
1+
import sys
22
import tarfile
33

4-
with tarfile.open('archive.zip') as tar:
4+
with tarfile.open(sys.argv[1]) as tar:
55
#BAD : This could write any file on the filesystem.
66
for entry in tar:
77
tar.extract(entry, "/tmp/unpack/")

‎python/ql/src/Security/CWE-022/examples/tarslip_good.py‎

Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)