mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 00:16:16 +00:00
Merge pull request #4380 from wschaeferB/4535-FixSevenzipDeDupe
4535 change path used for detection of existing files to not include data source
This commit is contained in:
commit
c63d0676b0
@ -185,7 +185,7 @@ class SevenZipExtractor {
|
|||||||
//As a result, many corrupted files have wonky compression ratios and could flood the UI
|
//As a result, many corrupted files have wonky compression ratios and could flood the UI
|
||||||
//with false zip bomb notifications. The decision was made to skip compression ratio checks
|
//with false zip bomb notifications. The decision was made to skip compression ratio checks
|
||||||
//for unallocated zip files. Instead, we let the depth be an indicator of a zip bomb.
|
//for unallocated zip files. Instead, we let the depth be an indicator of a zip bomb.
|
||||||
if(archiveFile.isMetaFlagSet(TskData.TSK_FS_META_FLAG_ENUM.UNALLOC)) {
|
if (archiveFile.isMetaFlagSet(TskData.TSK_FS_META_FLAG_ENUM.UNALLOC)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,11 +370,7 @@ class SevenZipExtractor {
|
|||||||
* @return the archiveFilePath to be used by the unpack method
|
* @return the archiveFilePath to be used by the unpack method
|
||||||
*/
|
*/
|
||||||
private String getArchiveFilePath(AbstractFile archiveFile) {
|
private String getArchiveFilePath(AbstractFile archiveFile) {
|
||||||
try {
|
return archiveFile.getParentPath() + archiveFile.getName();
|
||||||
return archiveFile.getUniquePath();
|
|
||||||
} catch (TskCoreException ex) {
|
|
||||||
return archiveFile.getParentPath() + archiveFile.getName();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -810,11 +806,11 @@ class SevenZipExtractor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UnpackStream used by the SevenZipBindings to do archive extraction. A memory
|
* UnpackStream used by the SevenZipBindings to do archive extraction. A
|
||||||
* leak exists in the SevenZip library that will not let go of the streams until
|
* memory leak exists in the SevenZip library that will not let go of the
|
||||||
* the entire archive extraction is complete. Instead of creating a new UnpackStream
|
* streams until the entire archive extraction is complete. Instead of
|
||||||
* for every file in the archive, instead we just rebase our EncodedFileOutputStream pointer
|
* creating a new UnpackStream for every file in the archive, instead we
|
||||||
* for every new file.
|
* just rebase our EncodedFileOutputStream pointer for every new file.
|
||||||
*/
|
*/
|
||||||
private final static class UnpackStream implements ISequentialOutStream {
|
private final static class UnpackStream implements ISequentialOutStream {
|
||||||
|
|
||||||
@ -846,17 +842,17 @@ class SevenZipExtractor {
|
|||||||
this.bytesWritten += bytes.length;
|
this.bytesWritten += bytes.length;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
throw new SevenZipException(
|
throw new SevenZipException(
|
||||||
NbBundle.getMessage(SevenZipExtractor.class,
|
NbBundle.getMessage(SevenZipExtractor.class,
|
||||||
"EmbeddedFileExtractorIngestModule.ArchiveExtractor.UnpackStream.write.exception.msg",
|
"EmbeddedFileExtractorIngestModule.ArchiveExtractor.UnpackStream.write.exception.msg",
|
||||||
localAbsPath), ex);
|
localAbsPath), ex);
|
||||||
}
|
}
|
||||||
return bytes.length;
|
return bytes.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
try(EncodedFileOutputStream out = output) {
|
try (EncodedFileOutputStream out = output) {
|
||||||
out.flush();
|
out.flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user