fix: Avoid exception when the malware file name contains a "|"

pull/1111/head
Raphaël Vinot 2023-11-29 12:35:24 +01:00
parent cc6391233c
commit c921017cf7
1 changed files with 1 additions and 2 deletions

View File

@ -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