1
0
mirror of https://github.com/golang/go synced 2024-11-12 07:10:22 -07:00

syscall: add some paranoia in Linux's Accept4

Fixes #7428

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/69530044
This commit is contained in:
Brad Fitzpatrick 2014-02-27 14:16:47 -08:00
parent dc6bf295b9
commit 0399b971d9

View File

@ -420,6 +420,9 @@ func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) {
if err != nil {
return
}
if len > SizeofSockaddrAny {
panic("RawSockaddrAny too small")
}
sa, err = anyToSockaddr(&rsa)
if err != nil {
Close(nfd)