diff options
author | irungentoo <irungentoo@gmail.com> | 2013-08-15 18:00:55 -0700 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-08-15 18:00:55 -0700 |
commit | add81b3426d661127c43fd80972f324cb684cae0 (patch) | |
tree | e0cccab811343ef6247b949733763858d60d8e26 | |
parent | b15230583c31799d650584b05f4cfce8cd726aea (diff) | |
parent | ff7b4f84187e28c83ed7d995ec8f2f475faa460f (diff) |
Merge pull request #471 from krisl/master
Add spam length to data length
-rw-r--r-- | core/friend_requests.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/friend_requests.c b/core/friend_requests.c index d4f8dd63..00beaa14 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.*/ |
34 | int send_friendrequest(uint8_t * public_key, uint32_t nospam_num, uint8_t * data, uint32_t length) | 34 | int 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]; |