mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fix bug where handle_NATping wouldn't perform bounds checking
This commit is contained in:
parent
f0397ebb2b
commit
9364db9eff
@ -1108,7 +1108,7 @@ static int send_NATping(uint8_t * public_key, uint64_t ping_id, uint8_t type)
|
||||
static int handle_NATping(uint8_t * packet, uint32_t length, IP_Port source)
|
||||
{
|
||||
if (length < crypto_box_PUBLICKEYBYTES * 2 + crypto_box_NONCEBYTES + ENCRYPTION_PADDING
|
||||
&& length > MAX_DATA_SIZE + ENCRYPTION_PADDING)
|
||||
|| length > MAX_DATA_SIZE + ENCRYPTION_PADDING)
|
||||
return 1;
|
||||
|
||||
/* check if request is for us. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user