From c921017cf7988fbe5a2f48dac027ce14f7a9cbea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Wed, 29 Nov 2023 12:35:24 +0100 Subject: [PATCH] fix: Avoid exception when the malware file name contains a "|" --- pymisp/mispevent.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pymisp/mispevent.py b/pymisp/mispevent.py index d08024c..ef83a2f 100644 --- a/pymisp/mispevent.py +++ b/pymisp/mispevent.py @@ -638,7 +638,7 @@ class MISPAttribute(AbstractMISP): def _prepare_new_malware_sample(self): if '|' in self.value: # Get the filename, ignore the md5, because humans. - self.malware_filename, md5 = self.value.split('|') + self.malware_filename, md5 = self.value.rsplit('|', 1) else: # Assuming the user only passed the filename self.malware_filename = self.value @@ -1665,7 +1665,6 @@ class MISPEvent(AbstractMISP): event_report.pop('sharing_group_id', None) to_return['EventReport'].append(event_report.to_dict()) - return {'Event': to_return} @property