Commit 5aff85301bdce7677766fa1367c82ff41a739637

suzuki toshiya 2014-11-26T14:36:12

* 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.

diff --git a/ChangeLog b/ChangeLog
index f0e7d7e..985512e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-11-26  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+	* 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  <wl@gnu.org>
 
 	*/*: s/Invalid_Argument/Invalid_Size_Handle/ where appropriate.
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index fe49dd8..4d60e88 100644
--- 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 ));