From: Russ Cox Date: Thu, 16 Feb 2012 20:23:50 +0000 (-0500) Subject: syscall: fix bounds check in Error X-Git-Tag: weekly.2012-02-22~184 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=014568bee123278ae51b0e6f53c909607806568e;p=gostls13.git syscall: fix bounds check in Error Fixes #3042. R=golang-dev, iant CC=golang-dev https://golang.org/cl/5675067 --- diff --git a/src/pkg/syscall/syscall_unix.go b/src/pkg/syscall/syscall_unix.go index 26a12a6278..d4e02f68a7 100644 --- a/src/pkg/syscall/syscall_unix.go +++ b/src/pkg/syscall/syscall_unix.go @@ -95,7 +95,7 @@ func (m *mmapper) Munmap(data []byte) (err error) { type Errno uintptr func (e Errno) Error() string { - if 0 <= e && int(e) < len(errors) { + if 0 <= int(e) && int(e) < len(errors) { s := errors[e] if s != "" { return s