aboutsummaryrefslogtreecommitdiff
path: root/decompress.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* 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-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 a magic number (6) for a constant (BZ_N_GROUPS).Federico Mena Quintero2019-06-241-1/+1
| | | | decompress.c (BZ2_decompress): Check nGroups against BZ_N_GROUPS.
* Make sure nSelectors is not out of rangeAlbert Astals Cid2019-06-241-1/+1
| | | | | | | | | | | | | | nSelectors is used in a loop from 0 to nSelectors to access selectorMtf which is UChar selectorMtf[BZ_MAX_SELECTORS]; so if nSelectors is bigger than BZ_MAX_SELECTORS it'll do an invalid memory access Fixes out of bounds access discovered while fuzzying karchive This was reported as CVE-2019-12900 BZ2_decompress in decompress.c in bzip2 through 1.0.6 has an out-of-bounds write when there are many selectors.
* 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/+22
|
* bzip2-1.0.5bzip2-1.0.5Julian Seward2007-12-101-2/+2
|
* bzip2-1.0.4bzip2-1.0.4Julian Seward2006-12-201-53/+13
|
* bzip2-1.0.3bzip2-1.0.3Julian Seward2005-02-151-7/+13
|
* bzip2-1.0.2bzip2-1.0.2Julian Seward2001-12-301-7/+7
|
* bzip2-1.0.1bzip2-1.0.1Julian Seward2000-06-241-10/+34
|
* bzip2-0.9.5dbzip2-0.9.5dJulian Seward1999-09-041-4/+4
|
* bzip2-0.9.0cbzip2-0.9.0cJulian Seward1998-08-231-0/+636