You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ByteBuf.nioBuffer(...) should only expose the sub-region of the buffer #1925
At the moment we only set the position and limit of the buffer and return it. This is not correct as it should only expose the sub-region (as stated in the javadocs).
What makes it even worse is that this way a user can access the data from other buffers when a pooled allocator is used by mistake and so cause data-corruption.
So we should slice the buffer before return it. For internal usage we can still use internalNioBuffer(..) which does not slice and so produce less GC
Activity
normanmaurer commentedon Oct 16, 2013
This is also related to #1920
[#1925] Only expose sub-region of ByteBuf on nioBuffer(...)
[#1925] Only expose sub-region of ByteBuf on nioBuffer(...)