summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2010-11-06 15:06:12 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2010-11-06 15:06:12 +0000
commit6e787e4178cff818a1c57d548c4b96bc49ffd222 (patch)
tree690bea46b85f1d52b6ec309ad16c9b9a9ca0218c /Build/source/texk/web2c
parent07ee1f7dbdcb2cb8c5a727b537b2474cbde729c3 (diff)
pTeX: avoid segfault
git-svn-id: svn://tug.org/texlive/trunk@20344 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c')
-rw-r--r--Build/source/texk/web2c/ptexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/ptexdir/ptex-base.ch2
2 files changed, 6 insertions, 1 deletions
diff --git a/Build/source/texk/web2c/ptexdir/ChangeLog b/Build/source/texk/web2c/ptexdir/ChangeLog
index ea2d8518bdb..3c4a83d76c8 100644
--- a/Build/source/texk/web2c/ptexdir/ChangeLog
+++ b/Build/source/texk/web2c/ptexdir/ChangeLog
@@ -1,3 +1,8 @@
+2010-11-04 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * ptex-base.ch (get_jfm_pos): Avoid accessing non-existent array
+ elements that could cause segmentation faults.
+
2010-06-10 Peter Breitenlohner <peb@mppmu.mpg.de>
* am/ptex.am (ptex_cppflags): Add $(AM_CPPFLAGS).
diff --git a/Build/source/texk/web2c/ptexdir/ptex-base.ch b/Build/source/texk/web2c/ptexdir/ptex-base.ch
index 778a9702713..96497a75e50 100644
--- a/Build/source/texk/web2c/ptexdir/ptex-base.ch
+++ b/Build/source/texk/web2c/ptexdir/ptex-base.ch
@@ -6719,7 +6719,7 @@ begin@/
jc:=toDVI(kcode);
sp:=1; { start position }
ep:=font_num_ext[f]-1; { end position }
-if (kchar_code(f)(sp)<=jc)and(jc<=kchar_code(f)(ep)) then
+if (ep>=1)and(kchar_code(f)(sp)<=jc)and(jc<=kchar_code(f)(ep)) then
begin while (sp <= ep) do
begin mp:=sp+((ep-sp) div 2);
if jc<kchar_code(f)(mp) then ep:=mp-1