Fix issues with OOB uids
This commit is contained in:
parent
a755608ef9
commit
2dafe4b390
1 changed files with 3 additions and 3 deletions
|
@ -191,9 +191,9 @@ func (store *MessageStore) Update(msg types.WorkerMessage) {
|
||||||
}
|
}
|
||||||
uids := make([]uint32, len(store.Uids)-len(msg.Uids))
|
uids := make([]uint32, len(store.Uids)-len(msg.Uids))
|
||||||
j := 0
|
j := 0
|
||||||
for i, uid := range store.Uids {
|
for _, uid := range store.Uids {
|
||||||
if _, deleted := toDelete[uid]; !deleted {
|
if _, deleted := toDelete[uid]; !deleted && j < len(uids) {
|
||||||
uids[j] = store.Uids[i]
|
uids[j] = uid
|
||||||
j += 1
|
j += 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue