diff options
author | Alan Somers <asomers@gmail.com> | 2022-07-23 13:34:33 -0600 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2022-07-23 14:46:42 -0600 |
commit | 098aba2c4a4fed68222f7f48dbab72aedd9177d8 (patch) | |
tree | b0c5563e2f6a104d4be9dcfb736ff2d601022c13 /src/lib.rs | |
parent | b1e1a604a713432773fb6bc8590ff9291c70a0bb (diff) | |
download | nix-098aba2c4a4fed68222f7f48dbab72aedd9177d8.zip |
Fix SockaddrLike::from_raw with unaligned inputs
The major users of this function are functions like gethostname, which
will always properly align their buffers. But out-of-crate consumers
could manually construct an unaligned buffer. Handle that correctly.
Enable Clippy's cast_ptr_alignment lint. It's disabled by default as it
reports many false positives, but it would've caught this problem.
Reported-by: Miri
Fixes: 1769
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -53,6 +53,7 @@ #![deny(missing_debug_implementations)] #![warn(missing_docs)] #![cfg_attr(docsrs, feature(doc_cfg))] +#![deny(clippy::cast_ptr_alignment)] // Re-exported external crates pub use libc; |