File tree 2 files changed +4
-2
lines changed
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ features = ["all"]
54
54
libc = " 0.2.172"
55
55
56
56
[target .'cfg(windows)' .dependencies .windows-sys ]
57
- version = " 0.52 "
57
+ version = " 0.59 "
58
58
features = [
59
59
" Win32_Foundation" ,
60
60
" 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> {
938
938
}
939
939
940
940
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 ] ) } ;
941
943
// `storage` was initialized to zero above, so the path is
942
944
// already null terminated.
943
- storage. sun_path [ ..bytes. len ( ) ] . copy_from_slice ( bytes ) ;
945
+ storage. sun_path [ ..bytes. len ( ) ] . copy_from_slice ( b ) ;
944
946
945
947
let base = storage as * const _ as usize ;
946
948
let path = & storage. sun_path as * const _ as usize ;
You can’t perform that action at this time.
0 commit comments