google / google/zerocopy

`TryFromBytes::read_read_from_*` should validate in-place before reading

Open
#2,981 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2.6k
Forks
179
Avg merge
1d 19h
Merged PRs (30d)
29

Description

Currently, we unconditionally read into the local stack frame and *then* verify the contents. For types with alignment 1, we should validate in-place, then only copy the source to a well-aligned stack allocation if it is valid.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.