Skip to content

Commit dc9bbd0

Browse files
committed
security: skip analysis if mime type failed
1 parent ff1d68a commit dc9bbd0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hooks/security.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ def check_file(self, event):
8282
# checksec only supports ELF files
8383
return
8484
mime = inode.file_magic_type
85+
if not mime:
86+
return
8587
filepath = inode.path
8688
if re.match(r'application/x(-pie)?-(executable|sharedlib)', mime):
8789
self.logger.info('Checking security of %s: %s', filepath, mime)

0 commit comments

Comments
 (0)