Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
Open
Description
Bug report
Bug description:
"Zip64 end of central directory record" may have additional data in the "zip64 extensible data sector" field.
In that case, zipfile should use offset from "Zip64 end of central directory locator".
Now it's read but ignored.
defrun_test():withzipfile.ZipFile("file-with-extended-zip64eocd-record.zip",allowZip64=True)asspecial_file:# This failsprint("success")
Problem lies in following code:
sig,diskno,reloff,disks=struct.unpack(structEndArchive64Locator,data)ifsig!=stringEndArchive64Locator:returnendrecifdiskno!=0ordisks>1:raiseBadZipFile("zipfiles that span multiple disks are not supported")# Assume no 'zip64 extensible data'fpin.seek(offset-sizeEndCentDir64Locator-sizeEndCentDir64,2)data=fpin.read(sizeEndCentDir64)
While it should be:
sig,diskno,reloff,disks=struct.unpack(structEndArchive64Locator,data)ifsig!=stringEndArchive64Locator:returnendrecifdiskno!=0ordisks>1:raiseBadZipFile("zipfiles that span multiple disks are not supported")fpin.seek(reloff,0)data=fpin.read(sizeEndCentDir64)
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
Metadata
Metadata
Assignees
Projects
Status
No status