mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #13603 from AdamKorcz/fuzz3
raft: fix out-of-bounds in maybeAppend
This commit is contained in:
commit
22f142a9f5
@ -95,6 +95,9 @@ func (l *raftLog) maybeAppend(index, logTerm, committed uint64, ents ...pb.Entry
|
||||
l.logger.Panicf("entry %d conflict with committed entry [committed(%d)]", ci, l.committed)
|
||||
default:
|
||||
offset := index + 1
|
||||
if ci-offset > uint64(len(ents)) {
|
||||
l.logger.Panicf("index, %d, is out of range [%d]", ci-offset, len(ents))
|
||||
}
|
||||
l.append(ents[ci-offset:]...)
|
||||
}
|
||||
l.commitTo(min(committed, lastnewi))
|
||||
|
Loading…
x
Reference in New Issue
Block a user