From 2772bffeebcda9c1947c9855fc4ad42ddb32cbea Mon Sep 17 00:00:00 2001 From: irungentoo Date: Tue, 8 Jul 2014 10:38:48 -0400 Subject: [PATCH] Fixed possible out of bounds read. --- toxcore/onion_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c index 7d0efc79..42982ea8 100644 --- a/toxcore/onion_client.c +++ b/toxcore/onion_client.c @@ -831,7 +831,7 @@ int onion_delfriend(Onion_Client *onion_c, int friend_num) uint32_t i; for (i = onion_c->num_friends; i != 0; --i) { - if (onion_c->friends_list[i].status != 0) + if (onion_c->friends_list[i - 1].status != 0) break; }