]> Cypherpunks repositories - gostls13.git/commit
compress/flate: reject invalid Huffman bit sizes
authorMatthew Dempsky <mdempsky@google.com>
Mon, 13 Apr 2015 22:31:28 +0000 (15:31 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 16 Apr 2015 07:34:04 +0000 (07:34 +0000)
commit5cc8561333313c4318d980fea9b5c2dab596b503
tree872c3a83ff61975f692f170ed056e5cb615485f3
parentf22911f35e2d5bc4736c2869493e83f23c64d62e
compress/flate: reject invalid Huffman bit sizes

If the requested coding bit sizes don't result in a full binary tree,
then reject the input as invalid.

Exception: We still need to allow degenerate Huffman codings with a
single 1-bit code to be compatible with zlib and files compressed with
Go's compress/flate package.

Update #10426.

Change-Id: I171b98d12e65b4deb9f4031cd802407ebb5e266c
Reviewed-on: https://go-review.googlesource.com/8922
Reviewed-by: Nigel Tao <nigeltao@golang.org>
src/compress/flate/flate_test.go
src/compress/flate/gen.go
src/compress/flate/inflate.go