From 90b9f4fd0a8afb29f56901ac48985102e11c5def Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Thu, 12 May 2022 18:28:54 -0300 Subject: [PATCH] Fix LZEXE executables containing ZIPs being incorrectly extracted --- biostools/extractors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/biostools/extractors.py b/biostools/extractors.py index dbdfc31..16fa39b 100644 --- a/biostools/extractors.py +++ b/biostools/extractors.py @@ -2410,10 +2410,10 @@ class VMExtractor(ArchiveExtractor): # All signatures should be within the first 32 KB or so. extractor = None extractor_kwargs = {} - if file_header[:2] == b'MZ': + if file_header[:2] == b'MZ' and b'PK\x03\x04' not in file_header: # skip self-extractors with compressed stubs if file_header[28:32] == b'LZ91': extractor = self._extract_lzexe - elif file_header[30:36] == b'PKLITE' and b'PK\x03\x04' not in file_header: # skip PKZIP self-extractor with PKLITE-compressed stub + elif file_header[30:36] == b'PKLITE': extractor = self._extract_pklite else: match = self._floppy_pattern.search(file_header)