shithub: freetype+ttf2subf

Download patch

ref: b185747dd6128526e4794a0768ac42b1570cc302
parent: 797ca5acb53c562613f1dc5d8bd7818c50f1daff
author: Werner Lemberg <[email protected]>
date: Sat Oct 17 10:21:41 EDT 2015

[bdf] Prevent memory leak (#46217).

* src/bdf/bdflib.c (_bdf_parse_glyphs) <STARTCHAR>: Check
_BDF_GLYPH_BITS.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2015-10-17  Werner Lemberg  <[email protected]>
 
+	[bdf] Prevent memory leak (#46217).
+
+	* src/bdf/bdflib.c (_bdf_parse_glyphs) <STARTCHAR>: Check
+	_BDF_GLYPH_BITS.
+
+2015-10-17  Werner Lemberg  <[email protected]>
+
 	[bdf] Use stream size to adjust number of glyphs.
 
 	* src/bdf/bdflib.c (ACMSG17): New message macro.
--- a/src/bdf/bdflib.c
+++ b/src/bdf/bdflib.c
@@ -1650,6 +1650,14 @@
     /* Check for the STARTCHAR field. */
     if ( _bdf_strncmp( line, "STARTCHAR", 9 ) == 0 )
     {
+      if ( p->flags & _BDF_GLYPH_BITS )
+      {
+        /* Missing ENDCHAR field. */
+        FT_ERROR(( "_bdf_parse_glyphs: " ERRMSG1, lineno, "ENDCHAR" ));
+        error = FT_THROW( Missing_Startchar_Field );
+        goto Exit;
+      }
+
       /* Set the character name in the parse info first until the */
       /* encoding can be checked for an unencoded character.      */
       FT_FREE( p->glyph_name );