From f30ce57af85c575334199f75dabca439c10657b0 Mon Sep 17 00:00:00 2001 From: Mark McKinnon Date: Fri, 26 Mar 2021 10:12:27 -0400 Subject: [PATCH] Add exception checking for file coming back from java-libpst Checking for parsing errors on file when it comes back from java-libpst --- .../org/sleuthkit/autopsy/thunderbirdparser/PstParser.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/PstParser.java b/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/PstParser.java index 9cbc8c6a6f..358c67a8a5 100644 --- a/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/PstParser.java +++ b/thunderbirdparser/src/org/sleuthkit/autopsy/thunderbirdparser/PstParser.java @@ -107,6 +107,11 @@ class PstParser implements AutoCloseable{ logger.log(Level.INFO, "Found encrypted PST file."); //NON-NLS return ParseResult.ENCRYPT; } + if (ex.getMessage().toLowerCase().startsWith("unable to")) { + logger.log(Level.WARNING, ex.getMessage()); + logger.log(Level.WARNING, String.format("Error in parsing PST file %s, file may be empty or corrupt", file.getName())); + return ParseResult.ERROR; + } String msg = file.getName() + ": Failed to create internal java-libpst PST file to parse:\n" + ex.getMessage(); //NON-NLS logger.log(Level.WARNING, msg, ex); return ParseResult.ERROR;