forked from TrueCloudLab/distribution
Fix read offset check for inmemory driver
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
This commit is contained in:
parent
59c399cb25
commit
c5bb224bf9
1 changed files with 1 additions and 1 deletions
|
@ -67,7 +67,7 @@ func (d *Driver) ReadStream(path string, offset uint64) (io.ReadCloser, error) {
|
||||||
contents, err := d.GetContent(path)
|
contents, err := d.GetContent(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if len(contents) < int(offset) {
|
} else if len(contents) <= int(offset) {
|
||||||
return nil, storagedriver.InvalidOffsetError{Path: path, Offset: offset}
|
return nil, storagedriver.InvalidOffsetError{Path: path, Offset: offset}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue