if toignore(fd):
continue
- mime = magic.from_file(fp, mime=True) if ms is None else ms.file(fp)
+ try:
+ mime = magic.from_file(fp, mime=True) if ms is None else ms.file(fp)
+ except UnicodeError:
+ warnproblem('malformed magic number', fd, fp)
if mime == 'application/x-sharedlib':
count += handleproblem('shared library', fd, fp)