mirror of
https://github.com/distribution/distribution.git
synced 2025-08-07 09:53:41 +00:00
Merge pull request #3815 from wy65701436/release/2.8-cp-3615
[release/2.8] Fix panic in inmemory driver
This commit is contained in:
commit
82d6c3d007
@ -279,6 +279,9 @@ func (f *file) sectionReader(offset int64) io.Reader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (f *file) ReadAt(p []byte, offset int64) (n int, err error) {
|
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
|
return copy(p, f.data[offset:]), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user