* src/base/ftobjs.c (FT_Get_Glyph_Name): Fix off-by-one check.

Problem reported by Dennis Felsing <dennis@felsin9.de>.
This commit is contained in:
Werner Lemberg 2014-12-11 13:39:39 +01:00
parent b94381134e
commit c9ca6ffc94
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2014-12-11 Werner Lemberg <wl@gnu.org>
* src/base/ftobjs.c (FT_Get_Glyph_Name): Fix off-by-one check.
Problem reported by Dennis Felsing <dennis@felsin9.de>.
2014-12-11 Werner Lemberg <wl@gnu.org>
* src/type42/t42parse.c (t42_parse_sfnts): Check `string_size'.

View File

@ -3648,8 +3648,10 @@
/* clean up buffer */
((FT_Byte*)buffer)[0] = '\0';
if ( (FT_Long)glyph_index > face->num_glyphs ||
!FT_HAS_GLYPH_NAMES( face ) )
if ( (FT_Long)glyph_index >= face->num_glyphs )
return FT_THROW( Invalid_Glyph_Index );
if ( !FT_HAS_GLYPH_NAMES( face ) )
return FT_THROW( Invalid_Argument );
FT_FACE_LOOKUP_SERVICE( face, service, GLYPH_DICT );