From 22fc3203db3cfab18674578e3245e203291aa53a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Tue, 19 Jul 2016 14:04:36 +0200 Subject: [PATCH] BUG/MINOR: peers: Fix peers data decoding issue This error led to truncated data after decoding upon receipt. It's specific to peers v2 and needs to be backported to 1.6. --- src/peers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/peers.c b/src/peers.c index bf22b9344..a8066c53e 100644 --- a/src/peers.c +++ b/src/peers.c @@ -225,7 +225,7 @@ uint64_t intdecode(char **str, char *end) { } i += (uint64_t)msg[idx] << (4 + 7*(idx-1)); } - while (msg[idx] > 128); + while (msg[idx] >= 128); *str = (char *)&msg[idx+1]; return i; }