From 4467ffe322592432dcf430c518ab5597499caabc Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Tue, 29 Oct 2019 22:27:39 +0200 Subject: [PATCH] bpo-38635: Simplify decoding the ZIP64 extra field and make it tolerant to extra data. --- Lib/zipfile.py | 53 +++++++++++++++----------------------------------- 1 file changed, 16 insertions(+), 37 deletions(-) diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 6504e0eee8b5a1..b0afb9da942b12 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -465,44 +465,23 @@ def _decodeExtra(self): if ln+4 > len(extra): raise BadZipFile("Corrupt extra field %04x (size=%d)" % (tp, ln)) if tp == 0x0001: - if ln >= 24: - counts = unpack('