Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lfcnassif opened this issue Oct 27, 2023 · 0 comments · Fixed by #1957
Closed

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

lfcnassif opened this issue Oct 27, 2023 · 0 comments · Fixed by #1957
Assignees
Labels

Comments

@lfcnassif
Copy link
Member

lfcnassif commented Oct 27, 2023

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:

synchronized (filesCache) {
tmp = filesCache.get(path);
}
if (tmp != null) {
return new SeekableFileInputStream(tmp.toFile());
}

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant