From f575fcddbaffc88ddf4dd63772ec7d450de55e5a Mon Sep 17 00:00:00 2001 From: Karl Mortensen Date: Tue, 24 Mar 2015 11:36:17 -0400 Subject: [PATCH] detect EOF in CacheLocationAnalyzer --- .../autopsy/modules/android/CacheLocationAnalyzer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/android/CacheLocationAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/android/CacheLocationAnalyzer.java index c669b1167d..c3a3d44ff3 100755 --- a/Core/src/org/sleuthkit/autopsy/modules/android/CacheLocationAnalyzer.java +++ b/Core/src/org/sleuthkit/autopsy/modules/android/CacheLocationAnalyzer.java @@ -66,7 +66,6 @@ class CacheLocationAnalyzer { } private static void findGeoLocationsInFile(File file, AbstractFile f) { - byte[] bytes; // will temporarily hold bytes to be converted into the correct data types try { @@ -87,7 +86,9 @@ class CacheLocationAnalyzer { bytes = new byte[1]; inputStream.read(bytes); while (new BigInteger(bytes).intValue() != 0) { //pass through non important values until the start of accuracy(around 7-10 bytes) - inputStream.read(bytes); + if (0 > inputStream.read(bytes)) { + break; /// we've passed the end of the file, so stop + } } bytes = new byte[3]; inputStream.read(bytes);