Skip to content

Commit

Permalink
handle message_number wraparound
Browse files Browse the repository at this point in the history
  • Loading branch information
zugz committed Jan 22, 2020
1 parent 886b9a7 commit f6c3ce6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion toxcore/group.c
Expand Up @@ -2618,7 +2618,7 @@ static Message_Info *find_message_slot_or_reject(uint32_t message_number, uint8_
Message_Info *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;
}

Expand Down

0 comments on commit f6c3ce6

Please sign in to comment.