Skip to content

wire: Use io.ReadFull in shortRead slow path#3622

Merged
davecgh merged 1 commit intodecred:masterfrom
jrick:readall
Feb 26, 2026
Merged

wire: Use io.ReadFull in shortRead slow path#3622
davecgh merged 1 commit intodecred:masterfrom
jrick:readall

Conversation

@jrick
Copy link
Copy Markdown
Member

@jrick jrick commented Feb 26, 2026

This avoids needing the fragile ErrUnexpectedEOF handling and prevents read errors when the reader is buffered and next chunk of bytes is only partially available.

Discovered by a failing wallet unit test which passed in a reader created by hex.NewDecoder.

This avoids needing the fragile ErrUnexpectedEOF handling and prevents read
errors when the reader is buffered and next chunk of bytes is only partially
available.

Discovered by a failing wallet unit test which passed in a reader created by
hex.NewDecoder.
@davecgh davecgh added this to the 2.2.0 milestone Feb 26, 2026
@jrick jrick changed the title wire: Use io.ReadAll in shortRead slow path wire: Use io.ReadFull in shortRead slow path Feb 26, 2026
@davecgh davecgh merged commit da48fb2 into decred:master Feb 26, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants