summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/lib/texmfmp.c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-02-01 04:41:12 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2017-02-01 04:41:12 +0000
commita40e4295260793e44bbfed4be68050c38e197f3e (patch)
treedefe1e45c701f505ce1b5c6e796103515580e350 /Build/source/texk/web2c/lib/texmfmp.c
parent89b3cef29b418b969f4ec641f77ae81515e55b53 (diff)
web2c/lib/texmfmp.c: avoid a crash in xelatex
git-svn-id: svn://tug.org/texlive/trunk@43113 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/lib/texmfmp.c')
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/lib/texmfmp.c b/Build/source/texk/web2c/lib/texmfmp.c
index 540837ad62c..47086d9bc0a 100644
--- a/Build/source/texk/web2c/lib/texmfmp.c
+++ b/Build/source/texk/web2c/lib/texmfmp.c
@@ -2818,6 +2818,8 @@ gettexstring (strnumber s)
unsigned bytesToWrite = 0;
poolpointer len, i, j;
string name;
+ if (strstart[s + 1 - 65536L] < strstart[s - 65536L])
+ return NULL;
len = strstart[s + 1 - 65536L] - strstart[s - 65536L];
name = xmalloc(len * 3 + 1); /* max UTF16->UTF8 expansion
(code units, not bytes) */