Fix a bug in the client
In very rare cases, at the very end of a deflate block, there will be a distance which has X bits in Huffman code, an end of block symbol with Y bits in Huffman code and distances have maximum Z bits in Huffman code. If X + Y < Z, then we incorrectly cache Z bits which we may not have enough bits to cover. This causes a crash in the client, but it is catchable in the paygen stage. This patch adds a new parameter in the Puffer to catch these scenarios and adds a new function RemoveDeflatesWithBadDistanceCaches() which detects and removes these problematic deflate instances. This function can be called from the update_engine to do that. Bug: crbug.com/915559 Test: unittests Test: puffin_corpus Change-Id: I450204dc3c0e3f56d263aff47c420eba65f8453b
Loading
Please sign in to comment