Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: parsing from IntoAsyncRead with small chunks #184

Merged
merged 1 commit into from
May 14, 2024

Conversation

arnauorriols
Copy link
Member

@arnauorriols arnauorriols commented May 7, 2024

BufReader does not guarantee that buffer().len() >= 8, which is the length of the V2 magic. Particularly when using IntoAsyncRead, the buffer is the first AsRef<[u8]> item in the wrapped stream, regardless of its size, failing to parse if the slice length is smaller than 8 bytes.

Copy link
Member

@magurotuna magurotuna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arnauorriols arnauorriols merged commit f779f4f into main May 14, 2024
3 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.

3 participants