From 6e787e4178cff818a1c57d548c4b96bc49ffd222 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Sat, 6 Nov 2010 15:06:12 +0000 Subject: pTeX: avoid segfault git-svn-id: svn://tug.org/texlive/trunk@20344 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/ptexdir/ChangeLog | 5 +++++ Build/source/texk/web2c/ptexdir/ptex-base.ch | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Build/source/texk/web2c') 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 + + * ptex-base.ch (get_jfm_pos): Avoid accessing non-existent array + elements that could cause segmentation faults. + 2010-06-10 Peter Breitenlohner * 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