forked from netty/netty
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix setBytes when source is read-only ByteBuffer and target is pooled…
… buffer Motivation: The method setBytes creates temporary heap buffer when source buffer is read-only. But this temporary buffer is not used correctly and may lead to data corruption. This problem occurs when target buffer is pooled and temporary buffer arrayOffset() is not zero. Modifications: Use correct arrayOffset when calling PlatformDependent.copyMemory. Unit test was added to test this case. Result: Setting buffer content works correctly when target is pooled buffer and source is read-only ByteBuffer.
- Loading branch information
1 parent
28d03ad
commit 42419d9
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters