summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/lib/ChangeLog6
-rw-r--r--Build/source/texk/web2c/lib/texmfmp.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/lib/ChangeLog b/Build/source/texk/web2c/lib/ChangeLog
index 7aa1516b480..390ae351183 100644
--- a/Build/source/texk/web2c/lib/ChangeLog
+++ b/Build/source/texk/web2c/lib/ChangeLog
@@ -1,3 +1,9 @@
+2017-02-01 Akira Kakuto <kakuto@fuk.kinidai.ac.jp>
+
+ * texmfmp.c: Avoid a crash in xelatex for
+ http://tug.org/pipermail/xetex/2017-January/026975.html.
+ It is not a fix but a stopgap.
+
2017-01-02 Akira Kakuto <kakuto@fuk.kinidai.ac.jp>
* printversion.c: 2016 ---> 2017.
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) */