mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
handle message_number wraparound
This commit is contained in:
parent
886b9a7019
commit
f6c3ce6d1f
|
@ -2618,7 +2618,7 @@ static Message_Info *find_message_slot_or_reject(uint32_t message_number, uint8_
|
||||||
Message_Info *i;
|
Message_Info *i;
|
||||||
|
|
||||||
for (i = peer->last_message_infos; i < peer->last_message_infos + peer->num_last_message_infos; ++i) {
|
for (i = peer->last_message_infos; i < peer->last_message_infos + peer->num_last_message_infos; ++i) {
|
||||||
if (message_number > i->message_number) {
|
if (message_number - (i->message_number + 1) <= ((uint32_t)1 << 31)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user