NewReadOnly fails on exhausted ReadSeeker
Open
P2
- Dominant language
- Go
- Stars
- 175
- Forks
- 54
- Avg merge
- 6d 5h
- Merged PRs (30d)
- 4
Description
- An os.File has GenerateIndex() called on
- This puts the os.File's underlying Reader at EOF
- If one then calls NewReadOnly [the check here](https://github.com/ipld/go-car/blob/v2.5.0/v2/blockstore/readonly.go#L155-L156) falls through to the io.Reader, sees the EOF and aborts
Observe the workaround at lines 81~83 in [the sequence here](https://github.com/ribasushi/fil-fip36-vote-tally/blob/cad0b4225/parsestate/util.go#L73-L91). A potential fix is to rewind when the argument is a ReadSeeker, before dropping to the Reader part.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.