netty5/buffer/src
Nick Hill d29f91540d Fix possible unsafe sharing of internal NIO buffer in CompositeByteBuf (#9169)
Motivation

A small thread-safety bug was introduced during the internal
optimizations of ComponentByteBuf made a while back in #8437. When there
is a single component which was added as a slice,
internalNioBuffer(int,int) will currently return the unwrapped slice's
un-duplicated internal NIO buffer. This is not safe since it could be
modified concurrently with other usage of that parent buffer.

Modifications

Delegate internalNioBuffer to nioBuffer in this case, which returns a
duplicate. This matches what's done in derived buffers in general
(for the same reason). Add unit test.

Result

Fixed possible thread-safety bug
2019-05-22 11:07:27 +02:00
..
main/java/io/netty/buffer Fix possible unsafe sharing of internal NIO buffer in CompositeByteBuf (#9169) 2019-05-22 11:07:27 +02:00
test/java/io/netty/buffer Fix possible unsafe sharing of internal NIO buffer in CompositeByteBuf (#9169) 2019-05-22 11:07:27 +02:00