Commits

Anonymous committed 4e4b161

hachoir-parser/archive/zlib: sanity-check on huffman codes to deal with broken files

Comments (0)

Files changed (1)

hachoir-parser/hachoir_parser/archive/zlib.py

 
         value = 0
         while (self.size, value) not in tree:
+            if self.size > 256:
+                raise ParserError("Huffman code too long!")
             bit = stream.readBits(addr, 1, endian)
             value <<= 1
             value += bit