Skip to content

Reject read-only output buffers in Snappy and BitShuffle ByteBuffer APIs - #777

Open
anvesha-dev wants to merge 1 commit into
xerial:mainfrom
anvesha-dev:readonly-output-buffer
Open

anvesha-dev wants to merge 1 commit into
xerial:mainfrom
anvesha-dev:readonly-output-buffer

Conversation

@anvesha-dev

Copy link
Copy Markdown

Snappy.compress/uncompress(ByteBuffer, ByteBuffer) and BitShuffle.shuffle/unshuffle(ByteBuffer, ...) pass the output's GetDirectBufferAddress pointer to native code without checking isReadOnly(), so an asReadOnlyBuffer() view is silently overwritten and a FileChannel.map(READ_ONLY) buffer crashes the JVM with SIGSEGV / EXCEPTION_ACCESS_VIOLATION; throw ReadOnlyBufferException there, like ByteBuffer.put does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant