• Ehren Kret's avatar
    compress/flate: prevent panic when reinitializing huffmanDecoder with bad input · 3b6b53f4
    Ehren Kret authored
    The huffmanDecoder struct appears to be intented for reuse by calling init a
    second time with a second sequence of code lengths. Unfortunately, it can
    currently panic if the second sequence of code lengths has a minimum value
    greater than 10 due to failure to reinitialize the links table.
    
    This change prevents the panic by resetting the huffmanDecoder struct back to
    the struct's zero value at the beginning of the init method if the
    huffmanDecoder is being reused (determined by checking if min has been set to a
    non-zero value).
    
    Fixes #6255.
    
    R=golang-dev, rsc
    CC=golang-dev
    https://golang.org/cl/13230043
    3b6b53f4
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...