marschall / memoryfilesystem

An in memory implementation of a JSR-203 file system
282 stars 36 forks source link

newInputStream and newOutputStream are not atomic #154

Open marschall opened 8 months ago

marschall commented 8 months ago

newInputStream and newOutputStream are not atomic:

They first call #getEntry which releases the lock and does not increment the open count. Only after this are the streams created and the open count incremented. This allows for a race where file can be deleted between #getEntry returning and the stream being created.