Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a05318f commit b5f1e9dCopy full SHA for b5f1e9d
1 file changed
python/ql/src/experimental/Security/CWE-022/zipslip_bad.py
@@ -2,13 +2,13 @@
2
import shutil
3
4
def unzip(filename):
5
- with zipfile.ZipFile(filename) as zipf:
+ with zipfile.ZipFile(filename) as zipf:
6
#BAD : This could write any file on the filesystem.
7
- for entry in zipf:
8
- shutil.copy(entry, "/tmp/unpack/")
+ for entry in zipf:
+ shutil.copy(entry, "/tmp/unpack/")
9
10
def unzip1(filename):
11
12
13
- with open(entry, 'wb') as dstfile:
14
- shutil.copyfileobj(zipf, dstfile)
+ with open(entry, 'wb') as dstfile:
+ shutil.copyfileobj(zipf, dstfile)
0 commit comments