Skip to content

Commit 912410e

Browse files
committed
Revert "fix _decompress security problem (PaddlePaddle#61294) (PaddlePaddle#61337)"
This reverts commit 0227a0d.
1 parent c00c2a6 commit 912410e

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

python/paddle/utils/download.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,7 @@ def _decompress(fname):
311311

312312
def _uncompress_file_zip(filepath):
313313
with zipfile.ZipFile(filepath, 'r') as files:
314-
file_list_tmp = files.namelist()
315-
file_list = []
316-
for file in file_list_tmp:
317-
file_list.append(file.replace("../", ""))
314+
file_list = files.namelist()
318315

319316
file_dir = os.path.dirname(filepath)
320317

@@ -343,10 +340,7 @@ def _uncompress_file_zip(filepath):
343340

344341
def _uncompress_file_tar(filepath, mode="r:*"):
345342
with tarfile.open(filepath, mode) as files:
346-
file_list_tmp = files.getnames()
347-
file_list = []
348-
for file in file_list_tmp:
349-
file_list.append(file.replace("../", ""))
343+
file_list = files.getnames()
350344

351345
file_dir = os.path.dirname(filepath)
352346

0 commit comments

Comments
 (0)