Merge pull request #3815 from wy65701436/release/2.8-cp-3615

[release/2.8] Fix panic in inmemory driver
pull/3893/head
Milos Gajdos 2023-04-17 15:58:21 +01:00 committed by GitHub
commit 82d6c3d007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -279,6 +279,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
}