[cff] Protect against invalid `hintmask' and `cntrmask' operators.
* src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_hintmask>: Ensure that we don't exceed `limit' while parsing the bit masks of the `hintmask' and `cntrmask' operators.
This commit is contained in:
parent
1c70fcbc0a
commit
e9f0cdb6c0
|
@ -1,3 +1,11 @@
|
||||||
|
2010-06-27 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
|
[cff] Protect against invalid `hintmask' and `cntrmask' operators.
|
||||||
|
|
||||||
|
* src/cff/cffgload.c (cff_decoder_parse_charstrings)
|
||||||
|
<cff_op_hintmask>: Ensure that we don't exceed `limit' while parsing
|
||||||
|
the bit masks of the `hintmask' and `cntrmask' operators.
|
||||||
|
|
||||||
2010-06-26 Werner Lemberg <wl@gnu.org>
|
2010-06-26 Werner Lemberg <wl@gnu.org>
|
||||||
|
|
||||||
Fix PFR change 2010-06-24.
|
Fix PFR change 2010-06-24.
|
||||||
|
|
|
@ -1341,6 +1341,14 @@
|
||||||
|
|
||||||
if ( hinter )
|
if ( hinter )
|
||||||
{
|
{
|
||||||
|
/* In a valid charstring there must be at least three bytes */
|
||||||
|
/* after `hintmask' or `cntrmask' (two for a `moveto' */
|
||||||
|
/* operator and one for `endchar'). Additionally, there */
|
||||||
|
/* must be space for `num_hints' bits. */
|
||||||
|
|
||||||
|
if ( ( ip + 3 + ( decoder->num_hints >> 8 ) ) >= limit )
|
||||||
|
goto Syntax_Error;
|
||||||
|
|
||||||
if ( op == cff_op_hintmask )
|
if ( op == cff_op_hintmask )
|
||||||
hinter->hintmask( hinter->hints,
|
hinter->hintmask( hinter->hints,
|
||||||
builder->current->n_points,
|
builder->current->n_points,
|
||||||
|
@ -1360,7 +1368,7 @@
|
||||||
FT_TRACE4(( " (maskbytes:" ));
|
FT_TRACE4(( " (maskbytes:" ));
|
||||||
|
|
||||||
for ( maskbyte = 0;
|
for ( maskbyte = 0;
|
||||||
maskbyte < (FT_UInt)(( decoder->num_hints + 7 ) >> 3);
|
maskbyte < (FT_UInt)( ( decoder->num_hints + 7 ) >> 3 );
|
||||||
maskbyte++, ip++ )
|
maskbyte++, ip++ )
|
||||||
FT_TRACE4(( " 0x%02X", *ip ));
|
FT_TRACE4(( " 0x%02X", *ip ));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue