mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
net_util: replace as <pointer> casts with safer alternatives
`as` casts can change mutability, which quickly leads to undefined behavior. Signed-off-by: Julian Schindel <mail@arctic-alpaca.de>
This commit is contained in:
committed by
Rob Bradford
parent
6de472f1bb
commit
2a6b746f5e
+1
-1
@@ -169,7 +169,7 @@ impl Tap {
|
||||
// Open calls are safe because we give a constant null-terminated
|
||||
// string and verify the result.
|
||||
libc::open(
|
||||
c"/dev/net/tun".as_ptr() as *const c_char,
|
||||
c"/dev/net/tun".as_ptr().cast(),
|
||||
flags.unwrap_or(libc::O_RDWR | libc::O_NONBLOCK | libc::O_CLOEXEC),
|
||||
)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user