facebook / zstd

Zstandard - Fast real-time compression algorithm
http://www.zstd.net
Other
22.77k stars 2.03k forks source link

Throw error if Huffman weight initial states are truncated #4079

Closed elasota closed 4 days ago

elasota commented 2 weeks ago

Fixes #4071 and effectively fixes #4037 by considering this behavior to be invalid

elasota commented 2 weeks ago

I think this is good to have for safety reasons anyway since BIT_readBits is undefined for over-consuming bits, and I would interpret undefined as "not guaranteed to return an in-range value," which is unsafe in this situation. I'm not sure what situation it would ever do such a thing, but this will take that off the table.

elasota commented 2 weeks ago

Poking CI to re-run the check that failed due to server error.