sepinf-inc / IPED

IPED Digital Forensic Tool. It is an open source software that can be used to process and analyze digital evidence, often seized at crime scenes by law enforcement or in a corporate investigation by private examiners.
Other
893 stars 214 forks source link

FileNotFoundException might be caused by race condition reading UFDR evidence #1955

Closed lfcnassif closed 8 months ago

lfcnassif commented 8 months ago

While working on #1224, I noticed the return statement below might cause FNFE because the File got in the block right before can be deleted from disk when adding a new File to the cache since it has a max size: https://github.com/sepinf-inc/IPED/blob/ad61a6f6b6ecf588c2bfc41ae6b87e011dfaeb31/iped-engine/src/main/java/iped/engine/io/ZIPInputStreamFactory.java#L159-L164

I have never seen this happen in practice, but it is possible. The fix is simply moving the return statement into the synchronized block.