-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sock_ctrl_msg: mark recv_with_fds as unsafe
Writes to arbitrary pointers are unsafe in Rust. It's the caller's job to ensure that it's safe for the memory they are writing to can contain whatever arbitrary bytes are received over the socket. For example, it would be unsafe to have an iovec pointing to the return value of str::as_mut_ptr, because strings can only contain byte sequences that are valid UTF-8. Because it's on the caller to make sure they're passing pointers safely, any function that writes to iovecs has to be marked as unsafe. Signed-off-by: Alyssa Ross <hi@alyssa.is>
- Loading branch information
Showing
1 changed file
with
43 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters