summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/pdftexdir/tounicode.c
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-12-15 16:41:59 +0000
committerKarl Berry <karl@freefriends.org>2017-12-15 16:41:59 +0000
commit23cf3e3a25dd34f8465bd69849dc4bb7fd6a62f4 (patch)
tree8ecd967fd10e515ff16c714ebeebbf4d73460964 /Build/source/texk/web2c/pdftexdir/tounicode.c
parent1911cb8e323a17c1b19881487328902dff5d73bc (diff)
(deftounicode): check that \pdfglyphtounicode target is in range [pdftex r786]
git-svn-id: svn://tug.org/texlive/trunk@46069 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/pdftexdir/tounicode.c')
-rw-r--r--Build/source/texk/web2c/pdftexdir/tounicode.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Build/source/texk/web2c/pdftexdir/tounicode.c b/Build/source/texk/web2c/pdftexdir/tounicode.c
index 16ab10bdae2..716ebf6ea66 100644
--- a/Build/source/texk/web2c/pdftexdir/tounicode.c
+++ b/Build/source/texk/web2c/pdftexdir/tounicode.c
@@ -1,5 +1,5 @@
/*
-Copyright 2006-2014 Han The Thanh, <thanh@pdftex.org>
+Copyright 2006-2017 Han The Thanh, <thanh@pdftex.org>
This file is part of pdfTeX.
@@ -75,7 +75,7 @@ void deftounicode(strnumber glyph, strnumber unistr)
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 @@ void deftounicode(strnumber glyph, strnumber unistr)
} 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);