nghttp2_hd: Fix integer decoding bug

This commit is contained in:
Tatsuhiro Tsujikawa 2014-02-26 21:44:48 +09:00
parent 52cec35906
commit 18357512ed
1 changed files with 4 additions and 4 deletions

View File

@ -528,11 +528,11 @@ static uint8_t* decode_length(ssize_t *res, int *final, ssize_t initial,
*final = 1; *final = 1;
return in + 1; return in + 1;
} }
}
if(++in == last) { if(++in == last) {
*res = n; *res = n;
return in; return in;
} }
}
for(r = 0; in != last; ++in, r += 7) { for(r = 0; in != last; ++in, r += 7) {
n += (*in & 0x7f) << r; n += (*in & 0x7f) << r;
if(n >= (1 << 16)) { if(n >= (1 << 16)) {