aboutsummaryrefslogtreecommitdiff
path: root/compress.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Initialize the fave and cost arrays fullyMark Wielaard2022-05-261-2/+2
| | | | | | | | | | | | We try to be smart in sendMTFValues by initializing just nGroups number of elements instead of all BZ_N_GROUPS elements. But this means the compiler doesn't know all elements are correctly initialized and might warn. The arrays are really small, BZ_N_GROUPS, 6 elements. And nGroups == BZ_N_GROUPS is the common case. So just initialize them all always. Using a constant loop might also help the compiler to optimize the initialization. https://sourceware.org/bugzilla/show_bug.cgi?id=28904
* Prepare for 1.0.8 release.bzip2-1.0.8Mark Wielaard2019-07-131-2/+2
|
* Accept as many selectors as the file format allows.Mark Wielaard2019-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | But ignore any larger than the theoretical maximum, BZ_MAX_SELECTORS. The theoretical maximum number of selectors depends on the maximum blocksize (900000 bytes) and the number of symbols (50) that can be encoded with a different Huffman tree. BZ_MAX_SELECTORS is 18002. But the bzip2 file format allows the number of selectors to be encoded with 15 bits (because 18002 isn't a factor of 2 and doesn't fit in 14 bits). So the file format maximum is 32767 selectors. Some bzip2 encoders might actually have written out more selectors than the theoretical maximum because they rounded up the number of selectors to some convenient factor of 8. The extra 14766 selectors can never be validly used by the decompression algorithm. So we can read them, but then discard them. This is effectively what was done (by accident) before we added a check for nSelectors to be at most BZ_MAX_SELECTORS to mitigate CVE-2019-12900. The extra selectors were written out after the array inside the EState struct. But the struct has extra space allocated after the selector arrays of 18060 bytes (which is larger than 14766). All of which will be initialized later (so the overwrite of that space with extra selector values would have been harmless).
* Prepare for 1.0.7 release.bzip2-1.0.7Mark Wielaard2019-06-271-1/+1
|
* Change Julian's email address to jseward@acm.orgMark Wielaard2019-03-301-1/+1
|
* bzip2-1.0.6bzip2-1.0.6Julian Seward2010-09-061-2/+2
|
* bzip2-1.0.5bzip2-1.0.5Julian Seward2007-12-101-2/+2
|
* bzip2-1.0.4bzip2-1.0.4Julian Seward2006-12-201-65/+21
|
* bzip2-1.0.3bzip2-1.0.3Julian Seward2005-02-151-7/+9
|
* bzip2-1.0.2bzip2-1.0.2Julian Seward2001-12-301-5/+5
|
* bzip2-1.0.1bzip2-1.0.1Julian Seward2000-06-241-53/+140
|
* bzip2-0.9.5dbzip2-0.9.5dJulian Seward1999-09-041-51/+90
|
* bzip2-0.9.0cbzip2-0.9.0cJulian Seward1998-08-231-0/+588