summaryrefslogtreecommitdiff
path: root/Build/source/texk
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2012-02-02 09:02:55 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2012-02-02 09:02:55 +0000
commitb903bfd5c7a0dee62ddbea3568b7c06afef7afe6 (patch)
treeaf3d30e3f91e9656c595b1d1e9b20a15423aaafe /Build/source/texk
parentf47df11fd849dcd7536964a5c9bba5a8614d660f (diff)
ofm2opl: Allow arbitrarily long OFM files and avoid Segmentation fault
TFtoPL, ofm2opl, opl2ofm, ovf2ovp: Minor bug fixes and clean up git-svn-id: svn://tug.org/texlive/trunk@25275 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r--Build/source/texk/web2c/ChangeLog2
-rw-r--r--Build/source/texk/web2c/omegaware/ChangeLog10
-rw-r--r--Build/source/texk/web2c/omegaware/ofm2opl.ch11
-rw-r--r--Build/source/texk/web2c/omegaware/ofm2opl.web2
-rw-r--r--Build/source/texk/web2c/omegaware/opl2ofm.web1
-rw-r--r--Build/source/texk/web2c/omegaware/ovf2ovp.web2
-rw-r--r--Build/source/texk/web2c/tftopl.ch1
7 files changed, 22 insertions, 7 deletions
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog
index 73c38bb40bb..1134c60a997 100644
--- a/Build/source/texk/web2c/ChangeLog
+++ b/Build/source/texk/web2c/ChangeLog
@@ -3,6 +3,8 @@
* tex.ch, gftodvi.ch: Ensure dvi file size < 2GB.
* mf.ch: Ensure gf file size < 2GB.
+ * tftopl.ch: Remove unused constant tfm_size.
+
2012-01-24 Karl Berry <karl@tug.org>
* doc/web2c.texi (Common options): remove doc for the long-since
diff --git a/Build/source/texk/web2c/omegaware/ChangeLog b/Build/source/texk/web2c/omegaware/ChangeLog
index bce4803320c..ab8c9ad0af3 100644
--- a/Build/source/texk/web2c/omegaware/ChangeLog
+++ b/Build/source/texk/web2c/omegaware/ChangeLog
@@ -1,3 +1,13 @@
+2012-02-01 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * ofm2opl.web, ovf2ovp.web: Both nl and lig_size are in words,
+ so the multiplication by 4 is not needed.
+
+ * ofm2opl.ch: Handle tfm_file_array as in TFtoPL, i.e., allocate
+ with a small initial size and reallocate as needed.
+
+ * ofm2opl.ch, opl2ofm.web: Remove unused constant tfm_size.
+
2012-01-24 Peter Breitenlohner <peb@mppmu.mpg.de>
* opl2ofm.web, ovp2ovf.web: Interpret "--" as "+", not "-".
diff --git a/Build/source/texk/web2c/omegaware/ofm2opl.ch b/Build/source/texk/web2c/omegaware/ofm2opl.ch
index c690e9cd387..cde0495cd88 100644
--- a/Build/source/texk/web2c/omegaware/ofm2opl.ch
+++ b/Build/source/texk/web2c/omegaware/ofm2opl.ch
@@ -53,10 +53,15 @@ procedure initialize; {this procedure gets things started properly}
kpse_init_prog ('OFM2OPL', 0, nil, nil);
{We |xrealloc| when we know how big the file is. The 1000 comes
from the negative lower bound.}
- tfm_file_array := cast_to_byte_pointer (xmalloc (2000000));
+ tfm_file_array := cast_to_byte_pointer (xmalloc (1009));
parse_arguments;
@z
+@x [4] Drop unused constant.
+@!tfm_size=2000000; {maximum length of |tfm| data, in bytes}
+@y
+@z
+
@x [7] Open the TFM file.
@ On some systems you may have to do something special to read a
packed file of bytes. For example, the following code didn't work
@@ -141,8 +146,8 @@ end;
if 4*lf-1>tfm_size then abort('The file is bigger than I can handle!');
@.The file is bigger...@>
@y
-{|tfm_file_array
- := cast_to_byte_pointer (xrealloc (tfm_file_array, 4 * lf - 1 + 1108));|}
+tfm_file_array
+ := cast_to_byte_pointer (xrealloc (tfm_file_array, 4 * lf - 1 + 1002));
@z
% [27, 28] Change strings to C char pointers. The Pascal strings are
diff --git a/Build/source/texk/web2c/omegaware/ofm2opl.web b/Build/source/texk/web2c/omegaware/ofm2opl.web
index c34cc817da9..3d0ee70bcc6 100644
--- a/Build/source/texk/web2c/omegaware/ofm2opl.web
+++ b/Build/source/texk/web2c/omegaware/ofm2opl.web
@@ -627,7 +627,7 @@ if lf<>(header_length+lh+ncw+nw+nh+nd+ni+nlw+nk+neew+np+
@.Subfile sizes don't add up...@>
if lh<2 then abort('The header length is only ',lh:1,'!');
@.The header length...@>
-if nl>4*lig_size then
+if nl>lig_size then
abort('The lig/kern program is longer than I can handle!');
@.The lig/kern program...@>
if (bc>ec+1)or(ec>top_char) then abort('The character code range ',
diff --git a/Build/source/texk/web2c/omegaware/opl2ofm.web b/Build/source/texk/web2c/omegaware/opl2ofm.web
index 9d0dd6f93f4..e73f058c8b8 100644
--- a/Build/source/texk/web2c/omegaware/opl2ofm.web
+++ b/Build/source/texk/web2c/omegaware/opl2ofm.web
@@ -126,7 +126,6 @@ reduce \.{PLtoTF}'s capacity.
@!hash_size=130003; {preferably a prime number, a bit larger than the number
of character pairs in lig/kern steps}
@!hash_mult=16007; {another prime}
-@!tfm_size=2000000; {maximum length of |tfm| data, in bytes}
@!lig_size=800000; {maximum length of |lig_kern| program, in words}
@!max_char=65535; {the largest character number in a font}
@!xmax_char=65536; {|max_char|+1}
diff --git a/Build/source/texk/web2c/omegaware/ovf2ovp.web b/Build/source/texk/web2c/omegaware/ovf2ovp.web
index e6048c024fe..30fc71c9e03 100644
--- a/Build/source/texk/web2c/omegaware/ovf2ovp.web
+++ b/Build/source/texk/web2c/omegaware/ovf2ovp.web
@@ -777,7 +777,7 @@ if lf<>(header_length+lh+ncw+nw+nh+nd+ni+nlw+nk+neew+np+
@.Subfile sizes don't add up...@>
if lh<2 then abort('The header length is only ',lh:1,'!');
@.The header length...@>
-if nl>4*lig_size then
+if nl>lig_size then
abort('The lig/kern program is longer than I can handle!');
@.The lig/kern program...@>
if (bc>ec+1)or(ec>top_char) then abort('The character code range ',
diff --git a/Build/source/texk/web2c/tftopl.ch b/Build/source/texk/web2c/tftopl.ch
index 3dcec53f165..33ce0dc564a 100644
--- a/Build/source/texk/web2c/tftopl.ch
+++ b/Build/source/texk/web2c/tftopl.ch
@@ -64,7 +64,6 @@ procedure initialize; {this procedure gets things started properly}
@!hash_size=5003; {preferably a prime number, a bit larger than the number
of character pairs in lig/kern steps}
@y
-@!tfm_size=150000; {maximum length of |tfm| data, in bytes}
@!lig_size=32510; {maximum length of |lig_kern| program, in words ($<2^{15}$)}
@!hash_size=32579; {preferably a prime number, a bit larger than the number
of character pairs in lig/kern steps}