From 235ce5685559e2cd64de96d0d2ac1aeafe86aeb5 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Sat, 19 Apr 2014 16:18:07 -0400 Subject: [PATCH] Fixed possible buffer overflow in function to send friend requests. --- toxcore/friend_requests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toxcore/friend_requests.c b/toxcore/friend_requests.c index 469ab02d0..e879d64c7 100644 --- a/toxcore/friend_requests.c +++ b/toxcore/friend_requests.c @@ -37,7 +37,7 @@ */ int send_friendrequest(Onion_Client *onion_c, 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];