-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…3086) Motivation: `CloseableIteratorBufferAsInputStream` uses `CLOSED` as a marker for `isClosed()`. However, `fromAscii("")` returns a static reference to `EmptyBuffer`, which opens a risk of getting such `Buffer` via underlying iterator. Modifications: - Use `wrap` method that guarantees allocation of a new unique instance of a `Buffer`; Result: `CLOSED` marker is guaranteed to be a unique instance. Additional cleanup of `AbstractCloseableIteratorAsInputStream`: - Remove `len - toRead` that always results in `0`; - Avoid arithmetic if `initialLen == len`;
- Loading branch information
1 parent
ec8ea4c
commit 99371cf
Showing
3 changed files
with
19 additions
and
4 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
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