summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Lipinski <kris.lipinski@gmail.com>2013-08-16 00:03:47 +1200
committerAaron Lipinski <kris.lipinski@gmail.com>2013-08-16 08:27:03 +1200
commitff7b4f84187e28c83ed7d995ec8f2f475faa460f (patch)
treec718c824b0dc2f0d28f599f6079f50a0abe0851b
parent9e3d5d6488b402805509befbf9619d9fc589b58b (diff)
Add spam length to data length in comparison against max size
-rw-r--r--core/friend_requests.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/friend_requests.c b/core/friend_requests.c
index ae19ebdd..0de2b498 100644
--- a/core/friend_requests.c
+++ b/core/friend_requests.c
@@ -33,7 +33,7 @@ uint8_t self_public_key[crypto_box_PUBLICKEYBYTES];
33 return the number of peers it was routed through if it did not send it directly.*/ 33 return the number of peers it was routed through if it did not send it directly.*/
34int send_friendrequest(uint8_t * public_key, uint32_t nospam_num, uint8_t * data, uint32_t length) 34int send_friendrequest(uint8_t * public_key, uint32_t nospam_num, uint8_t * data, uint32_t length)
35{ 35{
36 if(length - sizeof(nospam_num) > MAX_DATA_SIZE) 36 if(length + sizeof(nospam_num) > MAX_DATA_SIZE)
37 return -1; 37 return -1;
38 38
39 uint8_t temp[MAX_DATA_SIZE]; 39 uint8_t temp[MAX_DATA_SIZE];