diff --git a/ChangeLog b/ChangeLog index da002abce..b01e3c256 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2016-08-16 Werner Lemberg + + [lzw] Avoid invalid left shift. + + * src/lzw/ftzopen.c (ft_lzwstate_get_code): Limit `num_bits'. + 2016-08-16 Werner Lemberg [lzw] Avoid buffer overrun. diff --git a/src/lzw/ftzopen.c b/src/lzw/ftzopen.c index 32839cc32..ae79fdd24 100644 --- a/src/lzw/ftzopen.c +++ b/src/lzw/ftzopen.c @@ -65,6 +65,9 @@ FT_Int result; + if ( num_bits > LZW_MAX_BITS ) + return -1; + if ( state->buf_clear || offset >= state->buf_size || state->free_ent >= state->free_bits )