mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #6157 from siddontang/siddontang/fix-overflow
raft: fix overflow
This commit is contained in:
commit
d3812ed664
@ -339,7 +339,7 @@ func (l *raftLog) mustCheckOutOfBounds(lo, hi uint64) error {
|
||||
return ErrCompacted
|
||||
}
|
||||
|
||||
length := l.lastIndex() - fi + 1
|
||||
length := l.lastIndex() + 1 - fi
|
||||
if lo < fi || hi > fi+length {
|
||||
l.logger.Panicf("slice[%d,%d) out of bound [%d,%d]", lo, hi, fi, l.lastIndex())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user