fix: Avoid issues when there is no pe field in a windows file sample analysis

- For instance: doc file
pull/322/head
chrisr3d 2019-07-25 17:57:36 +02:00
parent 3d41104d5b
commit 3367e47490
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 5 additions and 1 deletions

View File

@ -281,7 +281,11 @@ class JoeParser():
relationship_type=relationship)) relationship_type=relationship))
def parse_pe(self, fileinfo, file_object): def parse_pe(self, fileinfo, file_object):
peinfo = fileinfo['pe'] try:
peinfo = fileinfo['pe']
except KeyError:
self.misp_event.add_object(**file_object)
return
pe_object = MISPObject('pe') pe_object = MISPObject('pe')
relationship = 'includes' relationship = 'includes'
file_object.add_reference(pe_object.uuid, relationship) file_object.add_reference(pe_object.uuid, relationship)