pdftex[786] branches/stable/source/src/texk/web2c/pdftexdir:

commits+karl at tug.org commits+karl at tug.org
Fri Dec 15 17:40:43 CET 2017


Revision: 786
          http://tug.org/svn/pdftex?view=revision&revision=786
Author:   karl
Date:     2017-12-15 17:40:43 +0100 (Fri, 15 Dec 2017)
Log Message:
-----------
(deftounicode): check that \pdfglyphtounicode target is in range

Modified Paths:
--------------
    branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog
    branches/stable/source/src/texk/web2c/pdftexdir/tounicode.c

Modified: branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog
===================================================================
--- branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog	2017-12-15 00:54:04 UTC (rev 785)
+++ branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog	2017-12-15 16:40:43 UTC (rev 786)
@@ -1,3 +1,8 @@
+2017-12-15  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* tounicode.c (deftounicode): check that value is in range [0,10FFFF].
+	Original report from Ross Moore, ntg-pdftex 30 May 2017 06:03:04.
+
 2017-11-28  Hironori KITAGAWA <h_kitagawa2001 at yahoo.co.jp>
 
 	Stop \pdfprimitive\vrule\q from swallowing q, by moving prim_eqtb

Modified: branches/stable/source/src/texk/web2c/pdftexdir/tounicode.c
===================================================================
--- branches/stable/source/src/texk/web2c/pdftexdir/tounicode.c	2017-12-15 00:54:04 UTC (rev 785)
+++ branches/stable/source/src/texk/web2c/pdftexdir/tounicode.c	2017-12-15 16:40:43 UTC (rev 786)
@@ -1,5 +1,5 @@
 /*
-Copyright 2006-2014 Han The Thanh, <thanh at pdftex.org>
+Copyright 2006-2017 Han The Thanh, <thanh at pdftex.org>
 
 This file is part of pdfTeX.
 
@@ -75,7 +75,7 @@
         p++;                    /* ignore leading spaces */
     l = strlen(p);
     while (l > 0 && p[l - 1] == ' ')
-        l--;                    /* ignore traling spaces */
+        l--;                    /* ignore trailing spaces */
     valid_unistr = 1;           /* a unicode value is the most common case */
     for (i = 0; i < l; i++) {
         if (p[i] == ' ')
@@ -117,6 +117,11 @@
     } else {
         i = sscanf(p, "%lX", &(gu->code));
         assert(i == 1);
+        if (gu->code < 0 || gu->code > 0x10FFFF) {
+            pdftex_warn("ToUnicode: value out of range [0,10FFFF]: %X",
+                        gu->code);
+            gu->code = UNI_UNDEF;
+        }
     }
     aa = avl_probe(glyph_unicode_tree, gu);
     assert(aa != NULL);



More information about the pdftex-commits mailing list