Skip to content

Commit

Permalink
Fix debug assertion for abstract namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasdezeeuw committed Jun 9, 2024
1 parent b453799 commit 2c66ff6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sys/unix/uds/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fn unix_addr(address: &SocketAddr) -> (libc::sockaddr_un, libc::socklen_t) {
// SAFETY: since `addr` is a valid Unix address, it must not be larger than
// `SUN_LEN` bytes, thus we won't overwrite the size of sockaddr.sun_path.
// SAFETY: null byte is already written because we zeroed the address above.
debug_assert!(addr.len() <= sockaddr.sun_path.len());
debug_assert!(offset + addr.len() <= sockaddr.sun_path.len());
unsafe {
ptr::copy_nonoverlapping(
addr.as_ptr(),
Expand Down

0 comments on commit 2c66ff6

Please sign in to comment.