From 0d6f4047c516a057b32a6048fa7b2b0ca0c42e0e Mon Sep 17 00:00:00 2001 From: Winston Howes Date: Wed, 3 Jun 2026 22:29:55 -0700 Subject: [PATCH] Fix Windows CA handle metadata init --- codex-rs/network-proxy/src/certs.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/codex-rs/network-proxy/src/certs.rs b/codex-rs/network-proxy/src/certs.rs index 780a13f745..d3ee637a72 100644 --- a/codex-rs/network-proxy/src/certs.rs +++ b/codex-rs/network-proxy/src/certs.rs @@ -580,7 +580,8 @@ fn windows_file_identity(file: &File) -> Result<(u32, u64)> { use windows_sys::Win32::Storage::FileSystem::BY_HANDLE_FILE_INFORMATION; use windows_sys::Win32::Storage::FileSystem::GetFileInformationByHandle; - let mut file_information = BY_HANDLE_FILE_INFORMATION::default(); + // SAFETY: Win32 fills this plain-old-data output struct before we read it. + let mut file_information = unsafe { std::mem::zeroed::() }; // SAFETY: `file` owns a live OS handle and `file_information` is writable. let result = unsafe { GetFileInformationByHandle(file.as_raw_handle() as _, &mut file_information) };