Impact
When SnappyFramedInputStream needed larger buffers, it returned its current buffers to the buffer pool before allocating replacements. If the allocation failed (for example with OutOfMemoryError caused by a large declared chunk length), the stream still referenced the released buffers, and close() released them to the pool a second time. The default CachingBufferPool does not detect duplicates, so two later SnappyFramedInputStream instances could receive the same backing array, and one stream's decompressed data could be read or overwritten through another.
Patches
Fixed in 1.1.10.10 (#747). Buffer fields are cleared right after release, so a failed allocation can no longer lead to a second release.
Workarounds
Discard the buffer pool after an OutOfMemoryError during decompression, or pass a non-caching BufferPool to SnappyFramedInputStream.
Impact
When
SnappyFramedInputStreamneeded larger buffers, it returned its current buffers to the buffer pool before allocating replacements. If the allocation failed (for example withOutOfMemoryErrorcaused by a large declared chunk length), the stream still referenced the released buffers, andclose()released them to the pool a second time. The defaultCachingBufferPooldoes not detect duplicates, so two laterSnappyFramedInputStreaminstances could receive the same backing array, and one stream's decompressed data could be read or overwritten through another.Patches
Fixed in 1.1.10.10 (#747). Buffer fields are cleared right after release, so a failed allocation can no longer lead to a second release.
Workarounds
Discard the buffer pool after an
OutOfMemoryErrorduring decompression, or pass a non-cachingBufferPooltoSnappyFramedInputStream.