From 18357512edc74477cc66361faad8b6448eb1665b Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 26 Feb 2014 21:44:48 +0900 Subject: [PATCH] nghttp2_hd: Fix integer decoding bug --- lib/nghttp2_hd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/nghttp2_hd.c b/lib/nghttp2_hd.c index fa0ebd72..a6477471 100644 --- a/lib/nghttp2_hd.c +++ b/lib/nghttp2_hd.c @@ -528,10 +528,10 @@ static uint8_t* decode_length(ssize_t *res, int *final, ssize_t initial, *final = 1; return in + 1; } - } - if(++in == last) { - *res = n; - return in; + if(++in == last) { + *res = n; + return in; + } } for(r = 0; in != last; ++in, r += 7) { n += (*in & 0x7f) << r;