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

std: Zero memory when calling read_to_end() #23668

Merged
merged 1 commit into from
Mar 25, 2015

Conversation

alexcrichton
Copy link
Member

This commit alters the behavior of the Read::read_to_end() method to zero all
memory instead of passing an uninitialized buffer to read. This change is
motivated by the discussion on the internals forum where the
conclusion has been that the standard library will not expose uninitialized
memory.

Closes #20314

This commit alters the behavior of the `Read::read_to_end()` method to zero all
memory instead of passing an uninitialized buffer to `read`. This change is
motivated by the [discussion on the internals forum][discuss] where the
conclusion has been that the standard library will not expose uninitialized
memory.

[discuss]: http://internals.rust-lang.org/t/uninitialized-memory/1652

Closes rust-lang#20314
@rust-highfive
Copy link
Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@aturon
Copy link
Member

aturon commented Mar 24, 2015

@bors: r+ 4ccf374

cc @nikomatsakis

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Mar 24, 2015
This commit alters the behavior of the `Read::read_to_end()` method to zero all
memory instead of passing an uninitialized buffer to `read`. This change is
motivated by the [discussion on the internals forum][discuss] where the
conclusion has been that the standard library will not expose uninitialized
memory.

[discuss]: http://internals.rust-lang.org/t/uninitialized-memory/1652

Closes rust-lang#20314
@bors bors merged commit 4ccf374 into rust-lang:master Mar 25, 2015
@alexcrichton alexcrichton deleted the io-zero branch March 27, 2015 20:37
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.

Safe methods in std::io allow reading uninit memory
4 participants