mirror of
https://github.com/TokTok/c-toxcore
synced 2026-10-25 10:23:18 +00:00
Add spam length to data length in comparison against max size
This commit is contained in:
1 parent
9e3d5d6488
commit
ff7b4f8418
1 file changed
+1
-1
@@ -33,7 +33,7 @@ uint8_t self_public_key[crypto_box_PUBLICKEYBYTES];
|
||||
return the number of peers it was routed through if it did not send it directly.*/
|
||||
int send_friendrequest(uint8_t * public_key, uint32_t nospam_num, uint8_t * data, uint32_t length)
|
||||
{
|
||||
if(length - sizeof(nospam_num) > MAX_DATA_SIZE)
|
||||
if(length + sizeof(nospam_num) > MAX_DATA_SIZE)
|
||||
return -1;
|
||||
|
||||
uint8_t temp[MAX_DATA_SIZE];
|
||||
|
||||
Reference in new issue
Block a user