mirror of
https://github.com/distribution/distribution.git
synced 2025-08-22 16:46:51 +00:00
Fix panic in inmemory driver
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
This commit is contained in:
parent
a6047a8c93
commit
1a75c71907
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user