Message270451
To reproduce:
>>> import lzma
>>> c = lzma.LZMACompressor()
>>> c.compress(b'')
b'\xfd7zXZ\x00\x00\x04\xe6\xd6\xb4F'
>>> c.compress(b'')
b''
>>> c.compress(b'')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
_lzma.LZMAError: Insufficient buffer space
>>> d = lzma.LZMADecompressor()
>>> d.decompress(b'')
b''
>>> d.decompress(b'')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
_lzma.LZMAError: Insufficient buffer space
This can occur anytime during compression/decompression when an empty string is passed twice in a row.
The problem is that that liblzma interprets a call to lzma_code() with avail_in == 0 as a buffer full condition. The second time in a row it encounters this, it returns LZMA_BUF_ERROR as per documentation. The attached patch prevents this condition from occurring. |
|
Date |
User |
Action |
Args |
2016-07-15 01:03:30 | benfogle | set | recipients:
+ benfogle |
2016-07-15 01:03:30 | benfogle | set | messageid: <1468544610.85.0.0793383244022.issue27517@psf.upfronthosting.co.za> |
2016-07-15 01:03:30 | benfogle | link | issue27517 messages |
2016-07-15 01:03:29 | benfogle | create | |
|