]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: fix bounds check in Error
authorRuss Cox <rsc@golang.org>
Thu, 16 Feb 2012 20:23:50 +0000 (15:23 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 16 Feb 2012 20:23:50 +0000 (15:23 -0500)
Fixes #3042.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5675067

src/pkg/syscall/syscall_unix.go

index 26a12a62788b67506bfff11d20cf69e1dd703fc6..d4e02f68a7b85e9d8bb8cd7ffce58c10c484b99d 100644 (file)
@@ -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