From b01b482cf2318270cc068484d36dc5d2512d2104 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 25 Oct 2023 22:31:35 -0500 Subject: [PATCH] Fix getsockopt zeroing memory (#901) This commit fixes an accidental regression from #858 where a previous call to `core::mem::zeroed` was replaced with `MaybeUninit::uninit` instead of `MaybeUninit::zeroed`. --- src/backend/libc/net/sockopt.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/libc/net/sockopt.rs b/src/backend/libc/net/sockopt.rs index bba12d10b..cff2ca288 100644 --- a/src/backend/libc/net/sockopt.rs +++ b/src/backend/libc/net/sockopt.rs @@ -84,7 +84,7 @@ fn getsockopt(fd: BorrowedFd<'_>, level: i32, optname: i32) -> io::Resu "Socket APIs don't ever use `bool` directly" ); - let mut value = MaybeUninit::::uninit(); + let mut value = MaybeUninit::::zeroed(); getsockopt_raw(fd, level, optname, &mut value, &mut optlen)?; // On Windows at least, `getsockopt` has been observed writing 1