Fix panic in inmemory driver

Signed-off-by: Shengjing Zhu <zhsj@debian.org>
This commit is contained in:
Shengjing Zhu 2022-03-27 19:38:07 +08:00 committed by Wang Yan
parent dc5b207fdd
commit ad5991de09

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
}