[tex-k] Patch to fix ttfdump segv

Hironobu Yamashita h.y.acetaminophen at gmail.com
Fri Jun 23 13:23:42 CEST 2017


Hello,


ttfdump causes segmentation fault when the requested ttc font
is not found;

$ ttfdump non-existent.ttc test.txt

Following patch can avoid SEGV


--- texk/ttfdump/src/ttfdump.c.orig	2017-06-23 20:15:42.000000000 +0900
+++ texk/ttfdump/src/ttfdump.c	2017-06-23 20:16:08.000000000 +0900
@@ -163,6 +163,10 @@
   if (strstr (ttfname, "ttc") != NULL)
   {
     ttc = ttfLoadTTCHeader(ttfname);
+
+    if (ttc == NULL)
+      exit(EXIT_FAILURE);
+
     if (collection < ttc->DirCount)
       font = ttc->font + collection;
     else


Regards,
Hironobu Yamashita


More information about the tex-k mailing list