summaryrefslogtreecommitdiffstats
path: root/Lib/zipfile
diff options
context:
space:
mode:
authorTim Hatch <tim@timhatch.com>2023-02-20 17:07:03 (GMT)
committerGitHub <noreply@github.com>2023-02-20 17:07:03 (GMT)
commit59e86caca812fc993c5eb7dc8ccd1508ffccba86 (patch)
treef667e940591ba09c44ff51635453c71e0ded890b /Lib/zipfile
parented01addb59a554804995303ad3e7bf0c6067737b (diff)
downloadcpython-59e86caca812fc993c5eb7dc8ccd1508ffccba86.zip
cpython-59e86caca812fc993c5eb7dc8ccd1508ffccba86.tar.gz
cpython-59e86caca812fc993c5eb7dc8ccd1508ffccba86.tar.bz2
gh-88233: zipfile: handle extras after a zip64 extra (GH-96161)
Previously, any data _after_ the zip64 extra would be removed. With many new tests. Fixes #88233 Automerge-Triggered-By: GH:jaraco
Diffstat (limited to 'Lib/zipfile')
-rw-r--r--Lib/zipfile/__init__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/zipfile/__init__.py b/Lib/zipfile/__init__.py
index e1833dd..6e6211d 100644
--- a/Lib/zipfile/__init__.py
+++ b/Lib/zipfile/__init__.py
@@ -207,6 +207,8 @@ def _strip_extra(extra, xids):
i = j
if not modified:
return extra
+ if start != len(extra):
+ buffer.append(extra[start:])
return b''.join(buffer)
def _check_zipfile(fp):