net: make parseProcNetIGMP more robust

Suggested by Paul Borman.

Fixes #2826.

R=rsc, borman
CC=golang-dev
https://golang.org/cl/5689048
This commit is contained in:
Mikio Hara 2012-02-23 06:26:31 +09:00
parent 880cda557a
commit 9765325d49
6 changed files with 119 additions and 17 deletions

View file

@ -67,7 +67,7 @@ func open(name string) (*file, error) {
if err != nil {
return nil, err
}
return &file{fd, make([]byte, 1024)[0:0], false}, nil
return &file{fd, make([]byte, os.Getpagesize())[0:0], false}, nil
}
func byteIndex(s string, c byte) int {