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 possible vulnerability when calling read on uninitialized buffer #2

Merged
merged 1 commit into from
Jan 3, 2021

Conversation

Enet4
Copy link
Owner

@Enet4 Enet4 commented Jan 3, 2021

Resolves #1.

Implementations of Read still can try to read buf on read, even though they shouldn't. This also eliminates all uses of unsafe in this crate.

Also:

  • derive Debug and Clone for GreedyAccessReader

- Implementations of Read still can try to read `buf` on `read`,
  even though they shouldn't
- also derive Debug and Clone for GreedyAccessReader
- all uses of unsafe were removed
@Enet4 Enet4 merged commit 6fe222c into master Jan 3, 2021
@Enet4 Enet4 deleted the bug/read_uninit_is_ub branch January 3, 2021 14:55
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.

reading on uninitialized buffer can cause UB (impl<R> BufRead for GreedyAccessReader<R>)
1 participant