Skip to content

Commit 51c9254

Browse files
committed
Refactor _validate_local_file_entry
1 parent 1b7d75a commit 51c9254

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/zipfile/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,7 +1593,8 @@ def _validate_local_file_entry(self, fp, offset, end_offset):
15931593
)
15941594

15951595
dd = self._scan_data_descriptor(fp, pos, end_offset, zip64)
1596-
1596+
if dd is None:
1597+
dd = self._scan_data_descriptor_no_sig(fp, pos, end_offset, zip64)
15971598
if dd is None:
15981599
return None
15991600

@@ -1636,7 +1637,7 @@ def _scan_data_descriptor(self, fp, offset, end_offset, zip64):
16361637

16371638
return crc, compress_size, file_size, dd_size
16381639

1639-
return self._scan_data_descriptor_no_sig(fp, offset, end_offset, zip64)
1640+
return None
16401641

16411642
def _scan_data_descriptor_no_sig(self, fp, offset, end_offset, zip64, chunk_size=8192):
16421643
dd_fmt = '<LQQ' if zip64 else '<LLL'

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy