[type1, type42] Check encoding array size (#45961).

* src/type1/t1load.c (parse_encoding), src/type42/t42parse.c
(t42_parse_encoding): Do it.
This commit is contained in:
Werner Lemberg 2015-09-15 06:49:06 +02:00
parent 3ea0d2c65a
commit 581c7e2a51
3 changed files with 25 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2015-09-15 Werner Lemberg <wl@gnu.org>
[type1, type42] Check encoding array size (#45961).
* src/type1/t1load.c (parse_encoding), src/type42/t42parse.c
(t42_parse_encoding): Do it.
2015-09-14 Alexei Podtelezhnikov <apodtele@gmail.com> 2015-09-14 Alexei Podtelezhnikov <apodtele@gmail.com>
* src/base/ftcalc.c (FT_MulFix) [FT_LONG64]: Improve. * src/base/ftcalc.c (FT_MulFix) [FT_LONG64]: Improve.

View File

@ -1192,6 +1192,15 @@
else else
count = (FT_Int)T1_ToInt( parser ); count = (FT_Int)T1_ToInt( parser );
/* only composite fonts (which we don't support) */
/* can have larger values */
if ( count > 256 )
{
FT_ERROR(( "parse_encoding: invalid encoding array size\n" ));
parser->root.error = FT_THROW( Invalid_File_Format );
return;
}
T1_Skip_Spaces( parser ); T1_Skip_Spaces( parser );
if ( parser->root.cursor >= limit ) if ( parser->root.cursor >= limit )
return; return;

View File

@ -332,6 +332,15 @@
else else
count = (FT_Int)T1_ToInt( parser ); count = (FT_Int)T1_ToInt( parser );
/* only composite fonts (which we don't support) */
/* can have larger values */
if ( count > 256 )
{
FT_ERROR(( "t42_parse_encoding: invalid encoding array size\n" ));
parser->root.error = FT_THROW( Invalid_File_Format );
return;
}
T1_Skip_Spaces( parser ); T1_Skip_Spaces( parser );
if ( parser->root.cursor >= limit ) if ( parser->root.cursor >= limit )
return; return;