From: Damien Neil Date: Wed, 27 Apr 2016 18:08:58 +0000 (-0700) Subject: syscall: fix uint64->int cast of control message header X-Git-Tag: go1.7beta1~449 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4edb40d441b0def61507e65141535de4d86b9edc;p=gostls13.git syscall: fix uint64->int cast of control message header Change-Id: I28980b307d10730b122a4f833809bc400d6aff24 Reviewed-on: https://go-review.googlesource.com/22525 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/syscall/sockcmsg_unix.go b/src/syscall/sockcmsg_unix.go index b7a7c83286..bc4caf54a2 100644 --- a/src/syscall/sockcmsg_unix.go +++ b/src/syscall/sockcmsg_unix.go @@ -62,7 +62,7 @@ func ParseSocketControlMessage(b []byte) ([]SocketControlMessage, error) { func socketControlMessageHeaderAndData(b []byte) (*Cmsghdr, []byte, error) { h := (*Cmsghdr)(unsafe.Pointer(&b[0])) - if h.Len < SizeofCmsghdr || int(h.Len) > len(b) { + if h.Len < SizeofCmsghdr || uint64(h.Len) > uint64(len(b)) { return nil, nil, EINVAL } return h, b[cmsgAlignOf(SizeofCmsghdr):h.Len], nil