Assure that the number of bits for deflatePrime() is valid.

pull/319/merge
Mark Adler 7 years ago
parent 5c44459c3b
commit 4346a16853
  1. 3
      deflate.c

@ -589,7 +589,8 @@ int ZEXPORT deflatePrime (strm, bits, value)
if (deflateStateCheck(strm)) return Z_STREAM_ERROR;
s = strm->state;
if (s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3))
if (bits < 0 || bits > 16 ||
s->sym_buf < s->pending_out + ((Buf_size + 7) >> 3))
return Z_BUF_ERROR;
do {
put = Buf_size - s->bi_valid;

Loading…
Cancel
Save