Commits

nneonneo  committed 4e4b161

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

  • Participants
  • Parent commits 87e9708

Comments (0)

Files changed (1)

File 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