gh-88233: zipfile: handle extras after a zip64 extra (GH-96161) · wrongnull/cpython@59e86ca · GitHub
Skip to content

Commit 59e86ca

Browse files
authored
pythongh-88233: zipfile: handle extras after a zip64 extra (pythonGH-96161)
Previously, any data _after_ the zip64 extra would be removed. With many new tests. Fixes python#88233 Automerge-Triggered-By: GH:jaraco
1 parent ed01add commit 59e86ca

3 files changed

Lines changed: 66 additions & 0 deletions

File tree

Lib/test/test_zipfile/test_core.py

Lines changed: 62 additions & 0 deletions

Lib/zipfile/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ def _strip_extra(extra, xids):
207207
i = j
208208
if not modified:
209209
return extra
210+
if start != len(extra):
211+
buffer.append(extra[start:])
210212
return b''.join(buffer)
211213

212214
def _check_zipfile(fp):
Lines changed: 2 additions & 0 deletions

0 commit comments

Comments
 (0)