Skip to content

Commit efa5a2d

Browse files
committed
Inflate: Fix out-of-bounds read (probably)
1 parent 563d273 commit efa5a2d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

inffast_chunk.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,12 @@
3939
extra, 15 bits for the distance code, 13 bits for distance extra) requires
4040
reading up to 48 input bits (6 bytes).
4141
42-
Chunked decoding, with two 10-bit fastpath cases, can read (10 + 10 + 15
43-
+ 5 + 15 + 13) / 8 = 8.5 bytes, followed by an 8-byte preload for the next
44-
iteration, giving 17 bytes.
42+
For chunked decoding use a hopefully-pesimistic bound of two worst-case
43+
advances: 7 + 7, plus one 8-byte refill.
4544
*/
4645
#ifdef INFLATE_CHUNK_READ_64LE
4746
#undef INFLATE_FAST_MIN_INPUT
48-
#define INFLATE_FAST_MIN_INPUT 17
47+
#define INFLATE_FAST_MIN_INPUT 22
4948
#endif
5049

5150
/* INFLATE_FAST_MIN_OUTPUT is usually 258, but we can copy two fast-path bytes

0 commit comments

Comments
 (0)