Merge pull request #3615 from zhsj/inmem-panic

Fix panic in inmemory driver
This commit is contained in:
Milos Gajdos 2022-03-27 16:20:31 +01:00 committed by GitHub
commit d2c9f72c6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -284,6 +284,9 @@ func (f *file) sectionReader(offset int64) io.Reader {
}
func (f *file) ReadAt(p []byte, offset int64) (n int, err error) {
if offset >= int64(len(f.data)) {
return 0, io.EOF
}
return copy(p, f.data[offset:]), nil
}