summaryrefslogtreecommitdiff
path: root/toxcore/friend_requests.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-04-19 16:18:07 -0400
committerirungentoo <irungentoo@gmail.com>2014-04-19 16:18:07 -0400
commit235ce5685559e2cd64de96d0d2ac1aeafe86aeb5 (patch)
treef0138aa955e9c842214e5d7c0a49a5be376b792a /toxcore/friend_requests.c
parent98bea094b38784281f784073051db6b4e1be2597 (diff)
Fixed possible buffer overflow in function to send friend requests.
Diffstat (limited to 'toxcore/friend_requests.c')
-rw-r--r--toxcore/friend_requests.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toxcore/friend_requests.c b/toxcore/friend_requests.c
index 469ab02d..e879d64c 100644
--- a/toxcore/friend_requests.c
+++ b/toxcore/friend_requests.c
@@ -37,7 +37,7 @@
37 */ 37 */
38int send_friendrequest(Onion_Client *onion_c, uint8_t *public_key, uint32_t nospam_num, uint8_t *data, uint32_t length) 38int send_friendrequest(Onion_Client *onion_c, uint8_t *public_key, uint32_t nospam_num, uint8_t *data, uint32_t length)
39{ 39{
40 if (length + sizeof(nospam_num) > MAX_DATA_SIZE) 40 if (length + sizeof(nospam_num) >= MAX_DATA_SIZE)
41 return -1; 41 return -1;
42 42
43 uint8_t temp[MAX_DATA_SIZE]; 43 uint8_t temp[MAX_DATA_SIZE];