Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7f2d242

Browse files
Update zipslip_good.py
1 parent 8649375 commit 7f2d242

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import zipfile
22

3-
zf = zipfile.ZipFile(filename)
4-
with zipfile.open() as zipf:
5-
for entry in zipf:
6-
zipf.extract(entry, "/tmp/unpack/")
3+
def unzip(filename, dir):
4+
zf = zipfile.ZipFile(filename)
5+
zf.extractall(dir)
6+
7+
8+
def unzip1(filename, dir):
9+
zf = zipfile.ZipFile(filename)
10+
zf.extract(dir)

0 commit comments

Comments
 (0)