File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ features = ["all"]
5454libc = " 0.2.172"
5555
5656[target .'cfg(windows)' .dependencies .windows-sys ]
57- version = " 0.52 "
57+ version = " 0.59 "
5858features = [
5959 " Win32_Foundation" ,
6060 " Win32_Networking_WinSock" ,
Original file line number Diff line number Diff line change @@ -938,9 +938,11 @@ pub(crate) fn unix_sockaddr(path: &Path) -> io::Result<SockAddr> {
938938 }
939939
940940 storage. sun_family = crate :: sys:: AF_UNIX as sa_family_t ;
941+ // SAFETY: casting `[u8]` to `[i8]` is safe.
942+ let b = unsafe { & * ( bytes as * const [ u8 ] as * const [ i8 ] ) } ;
941943 // `storage` was initialized to zero above, so the path is
942944 // already null terminated.
943- storage. sun_path [ ..bytes. len ( ) ] . copy_from_slice ( bytes ) ;
945+ storage. sun_path [ ..bytes. len ( ) ] . copy_from_slice ( b ) ;
944946
945947 let base = storage as * const _ as usize ;
946948 let path = & storage. sun_path as * const _ as usize ;
You can’t perform that action at this time.
0 commit comments