Carl Mastrangelo 6050c11192 http2/hpack: forbid excess and invalid padding in hpack decoder
This change fixes a few bugs in the HPACK decoder:
 * Excess trailing padding is treated as an error per the HPACK Spec
     section 5.2
 * Non EOS prefix padding is treated as an error
 * Max length is now enforced for all decoded symbols

The idea here is to keep track of the decoded symbol length, rather
than the number of unconsumed bits in cur.  To this end, nbits has
been renamed cbits (cur bits), and sbits (sym bits) has been
introduced.  The main problem with using nbits is that it can easily
be zero, such as when decoding {0xff, 0xff}.  Using a clear moniker
makes it easier to see why checking cbits > 0 at the end of the
function is incorrect.

Fixes golang/go#15614

Change-Id: I1ae868caa9c207fcf9c9dec7f10ee9f400211f99
Reviewed-on: https://go-review.googlesource.com/23067
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-13 23:09:52 +00:00
2014-12-09 14:17:11 +11:00
2016-01-08 17:00:32 +00:00
2014-12-09 14:17:11 +11:00
2016-04-11 18:41:48 +00:00
2015-12-14 00:45:27 +00:00
2014-12-09 14:17:11 +11:00
2016-05-01 04:31:21 +00:00
2014-12-08 10:44:07 +11:00
2015-03-18 17:04:12 +00:00
2015-02-18 23:42:41 +00:00
2012-03-17 15:20:00 +11:00
2012-01-25 15:31:30 -05:00

This repository holds supplementary Go networking libraries.

To submit changes to this repository, see http://golang.org/doc/contribute.html.
Description
[mirror] Go supplementary network libraries
Readme BSD-3-Clause 13 MiB
Languages
Go 99.9%