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

TendrilSink::ReadFrom should only use uninitialized bytes for Files #39

Open
mozfreddyb opened this issue Aug 30, 2019 · 0 comments
Open

Comments

@mozfreddyb
Copy link

The code:

            // FIXME: this exposes uninitialized bytes to a generic R type
            // this is fine for R=File which never reads these bytes,
            // but user-defined types might.
            // The standard library pushes zeros to `Vec<u8>` for that reason.
            unsafe {
                tendril.push_uninitialized(BUFFER_SIZE);
            }```
See also #4.

This seems icky, no? Couldn't one fix this with different code paths for R=File and any other R=io::Read?
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

No branches or pull requests

1 participant