diff options
author | irungentoo <irungentoo@gmail.com> | 2014-04-19 16:18:07 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2014-04-19 16:18:07 -0400 |
commit | 235ce5685559e2cd64de96d0d2ac1aeafe86aeb5 (patch) | |
tree | f0138aa955e9c842214e5d7c0a49a5be376b792a /toxcore/friend_requests.c | |
parent | 98bea094b38784281f784073051db6b4e1be2597 (diff) |
Fixed possible buffer overflow in function to send friend requests.
Diffstat (limited to 'toxcore/friend_requests.c')
-rw-r--r-- | toxcore/friend_requests.c | 2 |
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 | */ |
38 | int send_friendrequest(Onion_Client *onion_c, uint8_t *public_key, uint32_t nospam_num, uint8_t *data, uint32_t length) | 38 | int 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]; |