From 52f21e32518244f3008efbef073f9d3ac9e68b43 Mon Sep 17 00:00:00 2001 From: Evgeny Kurnevsky Date: Mon, 25 Jun 2018 10:00:40 +0300 Subject: [PATCH] Correct check for net_crypto packet index. --- toxcore/net_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index 6a8932d1..5eea7a50 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c @@ -727,7 +727,7 @@ static uint32_t num_packets_array(const Packets_Array *array) */ static int add_data_to_buffer(const Logger *log, Packets_Array *array, uint32_t number, const Packet_Data *data) { - if (number - array->buffer_start > CRYPTO_PACKET_BUFFER_SIZE) { + if (number - array->buffer_start >= CRYPTO_PACKET_BUFFER_SIZE) { return -1; }