Skip to content

Commit

Permalink
Correct check for net_crypto packet index.
Browse files Browse the repository at this point in the history
  • Loading branch information
kurnevsky authored and iphydf committed Jun 29, 2018
1 parent b9a75d9 commit 52f21e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion toxcore/net_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 52f21e3

Please sign in to comment.