From 4730452ce01044196af1e94c753825243458ab4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Mon, 15 Feb 2021 16:11:15 +0100 Subject: [PATCH] fix: Skip PE section if name is none AND size is 0. Related: #678 --- pymisp/tools/peobject.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pymisp/tools/peobject.py b/pymisp/tools/peobject.py index ea81f75..014fb07 100644 --- a/pymisp/tools/peobject.py +++ b/pymisp/tools/peobject.py @@ -113,6 +113,9 @@ class PEObject(AbstractMISPObjectGenerator): if self.__pe.sections: pos = 0 for section in self.__pe.sections: + if not section.name and not section.size: + # Skip section if name is none AND size is 0. + continue s = PESectionObject(section, standalone=self._standalone, default_attributes_parameters=self._default_attributes_parameters) self.add_reference(s.uuid, 'includes', 'Section {} of PE'.format(pos)) if ((self.__pe.entrypoint >= section.virtual_address)