Detect empty files within PYZArchive

This commit is contained in:
extremecoders-re 2026-04-07 15:35:04 +05:30 committed by GitHub
commit d4a7dab166
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -434,6 +434,11 @@ class PyInstArchive:
if not os.path.exists(fileDir):
os.makedirs(fileDir)
if length == 0:
print('[!] Warning: Empty file {0}'.format(filePath))
self._writePyc(filePath, b"")
continue
try:
data = f.read(length)
data = zlib.decompress(data)