mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-01 19:10:10 +03:00
Extract tar files with "data" filter in Python >= 3.12
This commit is contained in:
parent
88f6be3f19
commit
779715277e
|
@ -7,6 +7,7 @@ import re
|
|||
import shutil
|
||||
import struct
|
||||
import subprocess
|
||||
import sys
|
||||
from typing import Any
|
||||
|
||||
|
||||
|
@ -520,7 +521,10 @@ def extract_dep(url: str, filename: str, prefs: dict[str, str]) -> None:
|
|||
if sources_dir_abs != member_prefix:
|
||||
msg = "Attempted Path Traversal in Tar File"
|
||||
raise RuntimeError(msg)
|
||||
tgz.extractall(sources_dir)
|
||||
if sys.version_info <= (3, 11):
|
||||
tgz.extractall(sources_dir)
|
||||
else:
|
||||
tgz.extractall(sources_dir, filter="data")
|
||||
else:
|
||||
msg = "Unknown archive type: " + filename
|
||||
raise RuntimeError(msg)
|
||||
|
|
Loading…
Reference in New Issue
Block a user