summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJoakim Hulthe <joakim.hulthe@mullvad.net>2025-02-13 14:05:51 +0100
committerJoakim Hulthe <joakim.hulthe@mullvad.net>2025-02-25 13:37:41 +0100
commit405a774e3ffa559408e582521caac8492b097655 (patch)
tree194cc9e45e709fc1736468d3166ecda23767b508
parentc7b8c7f5c2655b4bff6819b607f7fec71e3c14ac (diff)
downloadmullvadvpn-405a774e3ffa559408e582521caac8492b097655.tar.xz
mullvadvpn-405a774e3ffa559408e582521caac8492b097655.zip
Fix safety comment position in talpid-routing::unix::macos::data
-rw-r--r--talpid-routing/src/unix/macos/data.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/talpid-routing/src/unix/macos/data.rs b/talpid-routing/src/unix/macos/data.rs
index 5ac83d0885..54fea3aaf9 100644
--- a/talpid-routing/src/unix/macos/data.rs
+++ b/talpid-routing/src/unix/macos/data.rs
@@ -858,15 +858,15 @@ impl RouteSocketAddress {
// the smallest size being 4 bytes.
let buffer_size = len + len % 4;
let mut buffer = vec![0u8; buffer_size];
+ // SAFETY: copying contents of addr into buffer is safe, as long as addr.len()
+ // returns a correct size for the socket address pointer.
unsafe {
- // SAFETY: copying conents of addr into buffer is safe, as long as addr.len()
- // returns a correct size for the socket address pointer.
std::ptr::copy_nonoverlapping(
addr.as_ptr() as *const _,
buffer.as_mut_ptr(),
len,
- );
- }
+ )
+ };
buffer
}
}