fix: CVE-2022-41723

This commit is contained in:
andyzhangx
2023-03-29 03:52:25 +00:00
parent d30ffe6d16
commit 81c2a77192
83 changed files with 727 additions and 218 deletions

View File

@@ -245,8 +245,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
break
}
}
bytes := (*[len(pp.Path)]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
sa.Name = string(bytes)
sa.Name = string(unsafe.Slice((*byte)(unsafe.Pointer(&pp.Path[0])), n))
return sa, nil
case AF_INET: