Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

secureSession.Read([]byte) seems to behave like io.ReadFull #76

Closed
raulk opened this issue Apr 23, 2020 · 0 comments · Fixed by #58
Closed

secureSession.Read([]byte) seems to behave like io.ReadFull #76

raulk opened this issue Apr 23, 2020 · 0 comments · Fixed by #58
Assignees
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@raulk
Copy link
Member

raulk commented Apr 23, 2020

On studying the Read([]byte) method, it seems like it strives to fill the buffer, which is contrary to the contract of io.Reader.

We should:

  • vacate the queued buffer ASAP whether the provided buffer is larger or smaller than the queued data, it doesn't matter, returning the effective number of bytes returned.
  • never eagerly block on further incoming data, if we already have data to return.
@raulk raulk added the kind/bug A bug in existing code (including security flaws) label Apr 23, 2020
@raulk raulk self-assigned this Apr 23, 2020
@raulk raulk closed this as completed in #58 Apr 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant