mirror of
https://github.com/golang/go
synced 2024-11-19 10:24:43 -07:00
io: fix SectionReader Seek to seek backwards
Fixes #899. R=golang-dev, rminnich, adg CC=golang-dev https://golang.org/cl/1749041
This commit is contained in:
parent
bf5b05f2d4
commit
56b3e5d644
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user