texlive[45267] Build/source/texk/web2c: pltotf.ch: web2c extends the

commits+kakuto at tug.org commits+kakuto at tug.org
Mon Sep 11 00:11:43 CEST 2017


Revision: 45267
          http://tug.org/svn/texlive?view=revision&revision=45267
Author:   kakuto
Date:     2017-09-11 00:11:43 +0200 (Mon, 11 Sep 2017)
Log Message:
-----------
pltotf.ch: web2c extends the range 0..32767 into short (-32768..32767), so add a test of overflow. (H. Yamashita).

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/ChangeLog
    trunk/Build/source/texk/web2c/pltotf.ch

Modified: trunk/Build/source/texk/web2c/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/ChangeLog	2017-09-10 22:10:52 UTC (rev 45266)
+++ trunk/Build/source/texk/web2c/ChangeLog	2017-09-10 22:11:43 UTC (rev 45267)
@@ -1,3 +1,9 @@
+2017-09-10  Hironobu Yamashita  <h.y.acetaminophen at gmail.com>
+
+	* pltotf.ch: web2c extends the range of 'lf' from 0..32767
+	into short (-32768..32767), but the overflow here ends up in
+	Bad metric (TFM) file. So add a test.
+
 2017-03-27  Karl Berry  <karl at freefriends.org>
 
 	* Makefile.am (AM_TESTS_ENVIRONMENT): use instead of TESTS_ENVIRONMENT.

Modified: trunk/Build/source/texk/web2c/pltotf.ch
===================================================================
--- trunk/Build/source/texk/web2c/pltotf.ch	2017-09-10 22:10:52 UTC (rev 45266)
+++ trunk/Build/source/texk/web2c/pltotf.ch	2017-09-10 22:11:43 UTC (rev 45267)
@@ -188,6 +188,21 @@
 @d out(#)==putbyte(#,tfm_file)
 @z
 
+% [130] web2c extends the range of 'lf' from 0..32767 into
+% short (-32768..32767), but the overflow here ends up in
+% Bad metric (TFM) file. So we add test here.
+ at x
+lf:=6+lh+(ec-bc+1)+memory[width]+memory[height]+memory[depth]+
+memory[italic]+nl+lk_offset+nk+ne+np;
+ at y
+lf:=6+lh+(ec-bc+1)+memory[width]+memory[height]+memory[depth]+
+memory[italic]+nl+lk_offset+nk+ne+np;
+if lf<0 then begin
+  print_ln('The total number of words in the TFM file too large!');
+  uexit(1);
+  end
+ at z
+
 @x [136] Fix output of reals.
 @p procedure out_scaled(x:fix_word); {outputs a scaled |fix_word|}
 var @!n:byte; {the first byte after the sign}



More information about the tex-live-commits mailing list