mirror of https://github.com/MISP/PyMISP
fix: Avoid exception when the malware file name contains a "|"
parent
cc6391233c
commit
c921017cf7
|
@ -638,7 +638,7 @@ class MISPAttribute(AbstractMISP):
|
||||||
def _prepare_new_malware_sample(self):
|
def _prepare_new_malware_sample(self):
|
||||||
if '|' in self.value:
|
if '|' in self.value:
|
||||||
# Get the filename, ignore the md5, because humans.
|
# Get the filename, ignore the md5, because humans.
|
||||||
self.malware_filename, md5 = self.value.split('|')
|
self.malware_filename, md5 = self.value.rsplit('|', 1)
|
||||||
else:
|
else:
|
||||||
# Assuming the user only passed the filename
|
# Assuming the user only passed the filename
|
||||||
self.malware_filename = self.value
|
self.malware_filename = self.value
|
||||||
|
@ -1665,7 +1665,6 @@ class MISPEvent(AbstractMISP):
|
||||||
event_report.pop('sharing_group_id', None)
|
event_report.pop('sharing_group_id', None)
|
||||||
to_return['EventReport'].append(event_report.to_dict())
|
to_return['EventReport'].append(event_report.to_dict())
|
||||||
|
|
||||||
|
|
||||||
return {'Event': to_return}
|
return {'Event': to_return}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Reference in New Issue