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 committed Jun 25, 2018
1 parent 29b2dd6 commit c0d294d
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 c0d294d

Please sign in to comment.