texlive[41706] Build/source/texk: null check before dereference

commits+karl at tug.org commits+karl at tug.org
Fri Jul 15 01:09:40 CEST 2016


Revision: 41706
          http://tug.org/svn/texlive?view=revision&revision=41706
Author:   karl
Date:     2016-07-15 01:09:40 +0200 (Fri, 15 Jul 2016)
Log Message:
-----------
null check before dereference

Modified Paths:
--------------
    trunk/Build/source/texk/README
    trunk/Build/source/texk/ttfdump/ChangeLog
    trunk/Build/source/texk/ttfdump/libttf/cmap.c
    trunk/Build/source/texk/ttfdump/libttf/name.c
    trunk/Build/source/texk/ttfdump/libttf/post.c

Modified: trunk/Build/source/texk/README
===================================================================
--- trunk/Build/source/texk/README	2016-07-14 22:47:17 UTC (rev 41705)
+++ trunk/Build/source/texk/README	2016-07-14 23:09:40 UTC (rev 41706)
@@ -96,7 +96,7 @@
 
 ttf2pk2 - maintained here, by us
 
-ttfdump - ?
+ttfdump - maintained here, by us, since Taiwan upstream apparently gone.
 
 upmendex 0.51 - by Takuji Tanaka
   http://www.ctan.org/pkg/upmendex

Modified: trunk/Build/source/texk/ttfdump/ChangeLog
===================================================================
--- trunk/Build/source/texk/ttfdump/ChangeLog	2016-07-14 22:47:17 UTC (rev 41705)
+++ trunk/Build/source/texk/ttfdump/ChangeLog	2016-07-14 23:09:40 UTC (rev 41706)
@@ -1,3 +1,11 @@
+2016-07-15  Adrian Johnson <ajohnson at redneon.com>
+
+	* libttf/cmap.c,
+	* libttf/name.c,
+	* libttf/post.c: check for null before dereferencing in case
+	of missing cmap/name/post tables.
+	tex-live mail of 9 Jul 2016 18:17:16.
+
 2015-07-07  Peter Breitenlohner  <peb at mppmu.mpg.de>
 
 	* Makefile.am: Better dependencies for 'make check'.

Modified: trunk/Build/source/texk/ttfdump/libttf/cmap.c
===================================================================
--- trunk/Build/source/texk/ttfdump/libttf/cmap.c	2016-07-14 22:47:17 UTC (rev 41705)
+++ trunk/Build/source/texk/ttfdump/libttf/cmap.c	2016-07-14 23:09:40 UTC (rev 41706)
@@ -225,6 +225,9 @@
 {
     USHORT i;
     
+    if (!cmap)
+	return;
+
     free(cmap->encoding);
 
     for (i = 0; i < cmap->numberOfMaps; i++)

Modified: trunk/Build/source/texk/ttfdump/libttf/name.c
===================================================================
--- trunk/Build/source/texk/ttfdump/libttf/name.c	2016-07-14 22:47:17 UTC (rev 41705)
+++ trunk/Build/source/texk/ttfdump/libttf/name.c	2016-07-14 23:09:40 UTC (rev 41706)
@@ -72,6 +72,10 @@
 void ttfFreeNAME(NAMEPtr name)
 {
     USHORT i;
+
+    if (!name)
+	return;
+
     for (i=0;i<name->numberOfRecords;i++)
 	ttfFreeNameRecordData(name->NameRecords+i);
     free(name->NameRecords);

Modified: trunk/Build/source/texk/ttfdump/libttf/post.c
===================================================================
--- trunk/Build/source/texk/ttfdump/libttf/post.c	2016-07-14 22:47:17 UTC (rev 41705)
+++ trunk/Build/source/texk/ttfdump/libttf/post.c	2016-07-14 23:09:40 UTC (rev 41706)
@@ -129,6 +129,10 @@
 void ttfFreePOST(POSTPtr post)
 {
     USHORT i, numGlyphs;
+
+    if (!post)
+	return;
+
     switch (post->format)
 	{
 	case 0x00020000:



More information about the tex-live-commits mailing list