From 4edb40d441b0def61507e65141535de4d86b9edc Mon Sep 17 00:00:00 2001 From: Damien Neil Date: Wed, 27 Apr 2016 11:08:58 -0700 Subject: [PATCH] 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 --- src/syscall/sockcmsg_unix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.48.1