forked from jruby/jruby
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid write target modifying shared src bytes
When the incoming bytes are on the heap, we can use them in-place for the string we pass to the Ruby write method. However, since the target IO-like may want to modify the incoming string, we must make sure it is marked as shared so our original src bytes will not be modified. This issue originally manifested in jruby#4903 and was fixed by always copying the incoming buffer, but marking the string shared has the same effecit if the target attempts to make any modifications.
- Loading branch information
Showing
1 changed file
with
19 additions
and
15 deletions.
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