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 GH-88233
(cherry picked from commit 59e86caca8)

Co-authored-by: Tim Hatch <tim@timhatch.com>
Automerge-Triggered-By: GH:jaraco
This commit is contained in:
Miss Islington (bot) 2023-02-20 09:33:00 -08:00 committed by GitHub
parent 1747be4641
commit 62c0327487
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 66 additions and 0 deletions

View file

@ -211,6 +211,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):