Commit 56b3e5d6 authored by Peter Mundy's avatar Peter Mundy Committed by Andrew Gerrand

io: fix SectionReader Seek to seek backwards

Fixes #899.

R=golang-dev, rminnich, adg
CC=golang-dev
https://golang.org/cl/1749041
parent bf5b05f2
...@@ -336,7 +336,7 @@ func (s *SectionReader) Seek(offset int64, whence int) (ret int64, err os.Error) ...@@ -336,7 +336,7 @@ func (s *SectionReader) Seek(offset int64, whence int) (ret int64, err os.Error)
case 2: case 2:
offset += s.limit offset += s.limit
} }
if offset < s.off || offset > s.limit { if offset < s.base || offset > s.limit {
return 0, os.EINVAL return 0, os.EINVAL
} }
s.off = offset s.off = offset
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment