-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packetbuffer: fix logic for FreePacket()
m_next_empty_packet_key is a random number that is incremented. In FreePacket(), the upper 32 bits are tested for equivalence. However, the incrementing of m_next_empty_packet_key could overflow the lower 32 bits, changing the upper 32. This would cause the if statement to be false and the packet to not be marked as empty. Starting with m_next_empty_packet_key with the lower 32 bits cleared, prevents this error by allowing 2^32 packets before overflowing, far more than can be reasonably expected.
- Loading branch information
1 parent
0c59286
commit ca4d1bc
Showing
2 changed files
with
7 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters