From f57b938a290349d827689710c8cd482e27817c70 Mon Sep 17 00:00:00 2001 From: apriestman Date: Mon, 30 Mar 2020 10:20:18 -0400 Subject: [PATCH] Fix NPE when page size is zero --- .../sleuthkit/autopsy/recentactivity/BinaryCookieReader.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/BinaryCookieReader.java b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/BinaryCookieReader.java index 1937377804..e36acbc5d4 100755 --- a/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/BinaryCookieReader.java +++ b/RecentActivity/src/org/sleuthkit/autopsy/recentactivity/BinaryCookieReader.java @@ -89,7 +89,7 @@ final class BinaryCookieReader implements Iterable { throw new IOException(cookieFile.getName() + " is not a cookie file"); //NON-NLS } - int[] sizeArray = null; + int[] sizeArray; int pageCount = dataStream.readInt(); if (pageCount != 0) { sizeArray = new int[pageCount]; @@ -97,8 +97,9 @@ final class BinaryCookieReader implements Iterable { for (int cnt = 0; cnt < pageCount; cnt++) { sizeArray[cnt] = dataStream.readInt(); } - + } else { LOG.log(Level.INFO, "No cookies found in {0}", cookieFile.getName()); //NON-NLS + sizeArray = new int[0]; } reader = new BinaryCookieReader(cookieFile, sizeArray);