Skip to content

Commit

Permalink
Fixed typo in TskIsImageSupported
Browse files Browse the repository at this point in the history
  • Loading branch information
APriestman committed Nov 1, 2016
1 parent 252814f commit 75d71cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions bindings/java/jni/dataModel_SleuthkitJNI.cpp
Expand Up @@ -2020,11 +2020,13 @@ JNIEXPORT jboolean JNICALL Java_org_sleuthkit_datamodel_SleuthkitJNI_isImageSupp
TskIsImageSupported tskIsImage;
TSK_TCHAR imagePathT[1024];
toTCHAR(env, imagePathT, 1024, imagePathJ);

// It seems like passing &imagePathT should work instead of making this new array,
// but it generated an EXCEPTION_ACCESS_VIOLATION during testing.
TSK_TCHAR ** imagePaths = (TSK_TCHAR**)tsk_malloc((1) * sizeof(TSK_TCHAR*));
bool result;
imagePaths[0] = imagePathT;
if (tskIsImage.openImage(1, imagePaths, TSK_IMG_TYPE_DETECT,
0)) {
if (tskIsImage.openImage(1, imagePaths, TSK_IMG_TYPE_DETECT, 0)) {
result = false;
} else {
if (tskIsImage.findFilesInImg()) {
Expand Down
2 changes: 1 addition & 1 deletion tsk/auto/is_image_supported.cpp
Expand Up @@ -24,7 +24,7 @@

TskIsImageSupported::TskIsImageSupported()
{
m_wasDataFound = true;
m_wasDataFound = false;
}

bool TskIsImageSupported::isImageSupported()
Expand Down

0 comments on commit 75d71cb

Please sign in to comment.