From: Peter Mundy Date: Thu, 8 Jul 2010 06:57:07 +0000 (+1000) Subject: io: fix SectionReader Seek to seek backwards X-Git-Tag: weekly.2010-07-14~41 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=56b3e5d644e737046d019516b577821b55f167fb;p=gostls13.git io: fix SectionReader Seek to seek backwards Fixes #899. R=golang-dev, rminnich, adg CC=golang-dev https://golang.org/cl/1749041 --- diff --git a/src/pkg/io/io.go b/src/pkg/io/io.go index dcdc883b1b..a41a674cea 100644 --- a/src/pkg/io/io.go +++ b/src/pkg/io/io.go @@ -336,7 +336,7 @@ func (s *SectionReader) Seek(offset int64, whence int) (ret int64, err os.Error) case 2: offset += s.limit } - if offset < s.off || offset > s.limit { + if offset < s.base || offset > s.limit { return 0, os.EINVAL } s.off = offset