RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted [v15]

Sergey Tsypanov stsypanov at openjdk.org
Fri Dec 15 09:27:51 UTC 2023


On Thu, 14 Dec 2023 23:04:25 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Sergey Tsypanov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8320971: Revert irrelevant changes
>
> src/java.base/share/classes/java/io/BufferedInputStream.java line 646:
> 
>> 644:             int avail = count - pos;
>> 645:             if (avail > 0) {
>> 646:                 if (isTrusted(out)) {
> 
> It might be cleaner for now to drop `isTrusted()` and just do the class check explicitly here. That still takes care of the main intent of not passing the buffer to an untrustworthy stream. Further cleanup and consolidation can be done later.

I think this would be doing double job, wouldn't it?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16879#discussion_r1427749255


More information about the core-libs-dev mailing list