Skip to content
Snippets Groups Projects
Commit 7919d050 authored by Greg DiCristofaro's avatar Greg DiCristofaro
Browse files

read no bytes when image path is missing

parent e2a6c99d
Branches
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@
package org.sleuthkit.datamodel;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
/**
* Represents a file system object stored in tsk_fs_info table FileSystem has a
......@@ -69,6 +70,10 @@ public void close() {
@Override
public int read(byte[] buf, long offset, long len) throws TskCoreException {
Content dataSource = getDataSource();
if (dataSource instanceof Image && ArrayUtils.isEmpty(((Image) dataSource).getPaths())) {
return 0;
}
return SleuthkitJNI.readFs(getFileSystemHandle(), buf, offset, len);
}
......
......@@ -183,6 +183,12 @@ protected synchronized int readInt(byte[] buf, long offset, long len) throws Tsk
//special case for 0-size file
return 0;
}
Content dataSource = getDataSource();
if (dataSource instanceof Image && ((Image) dataSource).getPaths() == null || ((Image) dataSource).getPaths().length == 0) {
return 0;
}
loadFileHandle();
return SleuthkitJNI.readFile(fileHandle, buf, offset, len);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment