Fix off-by-one error when computing padding

This commit is contained in:
Tatsuhiro Tsujikawa 2014-06-07 22:55:54 +09:00
parent b8ed74c1ec
commit 19ed13c753
1 changed files with 1 additions and 1 deletions

View File

@ -4158,7 +4158,7 @@ static ssize_t inbound_frame_compute_pad(nghttp2_inbound_frame *iframe)
DEBUGF(fprintf(stderr, "recv: padlen=%zu\n", padlen));
/* We cannot use iframe->frame.hd.length because of CONTINUATION */
if(padlen - (padlen > 255) - 1 > iframe->payloadleft) {
if(padlen - (padlen > 256) - 1 > iframe->payloadleft) {
return -1;
}