1
0
mirror of https://github.com/golang/go synced 2024-11-22 06:24:38 -07:00

syscall: fix bounds check in Error

Fixes #3042.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5675067
This commit is contained in:
Russ Cox 2012-02-16 15:23:50 -05:00
parent e574480ed1
commit 014568bee1

View 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