mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
Fixed some thread-safety issues in ScalpelCarver.
This commit is contained in:
parent
d46d055779
commit
9034e685da
@ -115,7 +115,7 @@ class ScalpelCarverIngestModule extends IngestModuleAdapter implements FileInges
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProcessResult process(AbstractFile abstractFile) {
|
public ProcessResult process(AbstractFile abstractFile) {
|
||||||
ScalpelCarver.init(); // RJCTODO: Is this ScalpelCarver class thread-safe?
|
ScalpelCarver.init();
|
||||||
|
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
return ProcessResult.OK;
|
return ProcessResult.OK;
|
||||||
|
@ -39,7 +39,7 @@ public class ScalpelCarver {
|
|||||||
|
|
||||||
private static final String SCALPEL_JNI_LIB = "libscalpel_jni";
|
private static final String SCALPEL_JNI_LIB = "libscalpel_jni";
|
||||||
private static final String SCALPEL_OUTPUT_FILE_NAME = "audit.txt";
|
private static final String SCALPEL_OUTPUT_FILE_NAME = "audit.txt";
|
||||||
private static boolean initialized = false;
|
private static volatile boolean initialized = false;
|
||||||
private static final Logger logger = Logger.getLogger(ScalpelCarver.class.getName());
|
private static final Logger logger = Logger.getLogger(ScalpelCarver.class.getName());
|
||||||
|
|
||||||
private static native void carveNat(String carverInputId, ReadContentInputStream input, String configFilePath, String outputFolderPath) throws ScalpelException;
|
private static native void carveNat(String carverInputId, ReadContentInputStream input, String configFilePath, String outputFolderPath) throws ScalpelException;
|
||||||
@ -48,7 +48,7 @@ public class ScalpelCarver {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean init() {
|
public static synchronized boolean init() {
|
||||||
if (initialized) {
|
if (initialized) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user