From e76629ae5af4e1b6d21212adfc58143a04636c69 Mon Sep 17 00:00:00 2001 From: Zeeshan Ali Khan Date: Sun, 11 Feb 2024 23:38:56 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=EF=B8=8F=20zb:=20Fix=20a=20pointer?= =?UTF-8?q?=20access=20on=20Windows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Details at: https://github.com/microsoft/windows-rs/issues/2842 --- zbus/src/win32.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zbus/src/win32.rs b/zbus/src/win32.rs index 24e1236df..f75e31e1b 100644 --- a/zbus/src/win32.rs +++ b/zbus/src/win32.rs @@ -214,7 +214,7 @@ pub fn socket_addr_get_pid(addr: &SocketAddr) -> Result { let tcp_table = tcp_table.as_mut_ptr().cast::(); let num_entries = unsafe { (*tcp_table).dwNumEntries }; for i in 0..num_entries { - let entry = unsafe { (*tcp_table).table.get_unchecked(i as usize) }; + let entry = unsafe { *(*tcp_table).table.as_ptr().add(i as usize) }; let port = (entry.dwLocalPort & 0xFFFF) as u16; let port = u16::from_be(port);