From ffa0b3ae8aa2b1837b49c9af65a21c383c966984 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Thu, 28 May 2015 11:12:11 -0400 Subject: [PATCH] Make FileTypeDetector.lookupFileType() more robust --- .../autopsy/modules/filetypeid/FileTypeDetector.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java index b851d590d5..f9ec030602 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java @@ -153,10 +153,13 @@ public class FileTypeDetector { ArrayList attributes = file.getGenInfoAttributes(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_FILE_TYPE_SIG); for (BlackboardAttribute attribute : attributes) { /** - * There should be at most one TSK_FILE_TYPE_SIG attribute. + * There should be at most one TSK_FILE_TYPE_SIG attribute... */ - fileType = attribute.getValueString(); - break; + String postedFileType = attribute.getValueString(); + if (null != postedFileType && !postedFileType.isEmpty()) { + fileType = postedFileType; + break; + } } return fileType; }