]> Cypherpunks repositories - gostls13.git/commitdiff
io: fix SectionReader Seek to seek backwards
authorPeter Mundy <go.peter.90@gmail.com>
Thu, 8 Jul 2010 06:57:07 +0000 (16:57 +1000)
committerAndrew Gerrand <adg@golang.org>
Thu, 8 Jul 2010 06:57:07 +0000 (16:57 +1000)
Fixes #899.

R=golang-dev, rminnich, adg
CC=golang-dev
https://golang.org/cl/1749041

src/pkg/io/io.go

index dcdc883b1ba32f19fbc868d47c0cc14aa4492aa2..a41a674cea90ac6d919815390605e3950e147ff3 100644 (file)
@@ -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