Skip to content

Commit

Permalink
🚑️ zb: Fix a pointer access on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
zeenix committed Feb 11, 2024
1 parent 4d13c62 commit e76629a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zbus/src/win32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ pub fn socket_addr_get_pid(addr: &SocketAddr) -> Result<u32, Error> {
let tcp_table = tcp_table.as_mut_ptr().cast::<MIB_TCPTABLE2>();
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);

Expand Down

0 comments on commit e76629a

Please sign in to comment.