From 3f3f873525a8bc05c2e5ef9419bf48787709780e Mon Sep 17 00:00:00 2001 From: Mark McKinnon Date: Sat, 18 Mar 2023 11:52:17 -0400 Subject: [PATCH 1/2] Update RecentDocumentsByLnk.java Check for null value, this can be null if you have a lnk file with a unc path in it. --- .../sleuthkit/autopsy/recentactivity/RecentDocumentsByLnk.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/RecentDocumentsByLnk.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/RecentDocumentsByLnk.java index 98351a09d4..c2b11cb633 100644 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/RecentDocumentsByLnk.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/RecentDocumentsByLnk.java @@ -167,6 +167,9 @@ class RecentDocumentsByLnk extends Extract { String fileName = FilenameUtils.getName(normalizePathName); String filePath = FilenameUtils.getPath(normalizePathName); List sourceFiles; + if (filePath == null) { + return null; + } try { sourceFiles = currentCase.getSleuthkitCase().getFileManager().findFilesExactNameExactPath(dataSource, fileName, filePath); for (AbstractFile sourceFile : sourceFiles) { From 8e63a9b7427660a7a55c7e631dcd0b19f3be24b3 Mon Sep 17 00:00:00 2001 From: Mark McKinnon Date: Sat, 18 Mar 2023 11:53:30 -0400 Subject: [PATCH 2/2] Update JLNK.java Check if string ends with \ and add it if it does not. Paths were not being returned properly --- Core/src/org/sleuthkit/autopsy/coreutils/JLNK.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/coreutils/JLNK.java b/Core/src/org/sleuthkit/autopsy/coreutils/JLNK.java index 5e8c680b9f..4fcba67c23 100644 --- a/Core/src/org/sleuthkit/autopsy/coreutils/JLNK.java +++ b/Core/src/org/sleuthkit/autopsy/coreutils/JLNK.java @@ -292,7 +292,16 @@ public class JLNK { } else if (linkTargetIdList != null && !linkTargetIdList.isEmpty()) { String ret = ""; for (String s : linkTargetIdList) { - ret += s; + if (s.endsWith("\\")) { + ret += s; + } else { + if (ret.endsWith("\\")) { + ret +=s; + } else { + ret += "\\"; + ret += s; + } + } } return ret; }