[#2024] services/object: Cover corner cases for children OutOfRange
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
parent
b9fb0d6050
commit
3875fef542
1 changed files with 3 additions and 2 deletions
|
@ -88,11 +88,12 @@ func (exec *execCtx) initFromChild(obj oid.ID) (prev *oid.ID, children []oid.ID)
|
||||||
var payload []byte
|
var payload []byte
|
||||||
|
|
||||||
if rng := exec.ctxRange(); rng != nil {
|
if rng := exec.ctxRange(); rng != nil {
|
||||||
seekLen := rng.GetLength()
|
|
||||||
seekOff := rng.GetOffset()
|
seekOff := rng.GetOffset()
|
||||||
|
seekLen := rng.GetLength()
|
||||||
|
seekTo := seekOff + seekLen
|
||||||
parSize := par.PayloadSize()
|
parSize := par.PayloadSize()
|
||||||
|
|
||||||
if seekOff+seekLen > parSize {
|
if seekTo < seekOff || parSize < seekOff || parSize < seekTo {
|
||||||
var errOutOfRange apistatus.ObjectOutOfRange
|
var errOutOfRange apistatus.ObjectOutOfRange
|
||||||
|
|
||||||
exec.err = errOutOfRange
|
exec.err = errOutOfRange
|
||||||
|
|
Loading…
Reference in a new issue