From c8bc69bc2db9c57ccf979550bc69655df5039a8a Mon Sep 17 00:00:00 2001 From: Damien Neil Date: Wed, 27 Apr 2016 13:13:20 -0700 Subject: [PATCH] unix: fix uint64->int cast of control message header Change-Id: I533233a08472b686d03573bcbae664c76919b18e Reviewed-on: https://go-review.googlesource.com/22527 Run-TryBot: Damien Neil Reviewed-by: Minux Ma TryBot-Result: Gobot Gobot --- unix/sockcmsg_unix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/sockcmsg_unix.go b/unix/sockcmsg_unix.go index 70af5a72..f1493a3e 100644 --- a/unix/sockcmsg_unix.go +++ b/unix/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