Differences From Artifact [a8810ba694]:
- File
src/OFDeflateStream.m
— part of check-in
[aee3bc12f7]
at
2013-10-29 22:15:49
on branch trunk
— OFDeflateStream: Fix tree construction.
When a bit length had more than 255 occurrences, it caused an integer
overflow and thus a corrupt tree.This also cleans up tree walking. (user: js, size: 17452) [annotate] [blame] [check-ins using]
To Artifact [b45e69217a]:
- File
src/OFDeflateStream.m
— part of check-in
[d1293b647a]
at
2013-10-29 22:56:11
on branch trunk
— OFDeflateStream: Fix reading uncompressed header.
In case the uncompressed header was incomplete, this overwrote the old
buffer instead of continuing it. (user: js, size: 17473) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
349 350 351 352 353 354 355 | case UNCOMPRESSED_BLOCK_HEADER: #define CTX _context.uncompressedHeader /* FIXME: This can be done more efficiently than unreading */ [_stream unreadFromBuffer: _buffer + _bufferIndex length: _bufferLength - _bufferIndex]; _bufferIndex = _bufferLength = 0; | | > | | 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 | case UNCOMPRESSED_BLOCK_HEADER: #define CTX _context.uncompressedHeader /* FIXME: This can be done more efficiently than unreading */ [_stream unreadFromBuffer: _buffer + _bufferIndex length: _bufferLength - _bufferIndex]; _bufferIndex = _bufferLength = 0; CTX.position += [_stream readIntoBuffer: CTX.length + CTX.position length: 4 - CTX.position]; if OF_UNLIKELY (CTX.position < 4) return bytesWritten; if OF_UNLIKELY ((CTX.length[0] | (CTX.length[1] << 8)) != (uint16_t)~(CTX.length[2] | (CTX.length[3] << 8))) @throw [OFInvalidFormatException exception]; |
︙ | ︙ |