Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
  • Loading branch information
nulano and radarhere committed Nov 4, 2022
1 parent c10c6bf commit 8947cbf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions winbuild/build_prepare.py
Expand Up @@ -480,8 +480,8 @@ def extract_dep(url, filename):
zf.extractall(sources_dir)
elif filename.endswith(".tar.gz") or filename.endswith(".tgz"):
with tarfile.open(file, "r:gz") as tgz:
for member in tgz.getmembers():
member_abspath = os.path.abspath(os.path.join(sources_dir, member.name))
for member in tgz.getnames():
member_abspath = os.path.abspath(os.path.join(sources_dir, member))
member_prefix = os.path.commonpath([sources_dir_abs, member_abspath])
if sources_dir_abs != member_prefix:
raise RuntimeError("Attempted Path Traversal in Tar File")
Expand Down

0 comments on commit 8947cbf

Please sign in to comment.