shithub: freetype+ttf2subf

Download patch

ref: 5aff85301bdce7677766fa1367c82ff41a739637
parent: 02b8e7e8d751605b133568b86fbb5dff48b6b5a5
author: suzuki toshiya <[email protected]>
date: Wed Nov 26 09:36:12 EST 2014

* src/base/ftobjs.c (Mac_Read_POST_Resource): Avoid memory leak
by a broken POST table in resource-fork.  Return after freeing
the buffered POST table when it is found to be broken.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-11-26  suzuki toshiya  <[email protected]>
+
+	* src/base/ftobjs.c (Mac_Read_POST_Resource): Avoid memory leak
+	by a broken POST table in resource-fork.  Return after freeing
+	the buffered POST table when it is found to be broken.
+
 2014-11-25  Werner Lemberg  <[email protected]>
 
 	*/*: s/Invalid_Argument/Invalid_Size_Handle/ where appropriate.
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1603,9 +1603,9 @@
       if ( error )
         goto Exit2;
       if ( FT_READ_LONG( rlen ) )
-        goto Exit;
+        goto Exit2;
       if ( FT_READ_USHORT( flags ) )
-        goto Exit;
+        goto Exit2;
       FT_TRACE3(( "POST fragment[%d]: offsets=0x%08x, rlen=0x%08x, flags=0x%04x\n",
                    i, offsets[i], rlen, flags ));