ref: c9ca6ffc9442b4b127f948e2d993454aa7791e59
parent: b94381134efd41c6885d38e08d14106feec7284b
author: Werner Lemberg <[email protected]>
date: Thu Dec 11 08:39:39 EST 2014
* src/base/ftobjs.c (FT_Get_Glyph_Name): Fix off-by-one check. Problem reported by Dennis Felsing <[email protected]>.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2014-12-11 Werner Lemberg <[email protected]>
+ * src/base/ftobjs.c (FT_Get_Glyph_Name): Fix off-by-one check.
+
+ Problem reported by Dennis Felsing <[email protected]>.
+
+2014-12-11 Werner Lemberg <[email protected]>
+
* src/type42/t42parse.c (t42_parse_sfnts): Check `string_size'.
Problem reported by Dennis Felsing <[email protected]>.
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -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 );