summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-02-22 23:14:17 +0000
committerKarl Berry <karl@freefriends.org>2021-02-22 23:14:17 +0000
commit8bc226db4176d6bdcc4c60761bbd4d0104f3786d (patch)
tree98f5d0513a218b8809710f79d2142f06830992c6 /Build/source
parent816e9d04948e67826f63af36da6b5412708750b4 (diff)
limit \numexpr recusion by expand_depth, like \number (from phelype)
git-svn-id: svn://tug.org/texlive/trunk@57850 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/web2c/etexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/etexdir/etex.ch3
-rw-r--r--Build/source/texk/web2c/pdftexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/pdftexdir/pdftex.web3
-rw-r--r--Build/source/texk/web2c/xetexdir/ChangeLog4
-rw-r--r--Build/source/texk/web2c/xetexdir/xetex.web3
6 files changed, 21 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/etexdir/ChangeLog b/Build/source/texk/web2c/etexdir/ChangeLog
index 5d6d225d293..4a71c7f3cc0 100644
--- a/Build/source/texk/web2c/etexdir/ChangeLog
+++ b/Build/source/texk/web2c/etexdir/ChangeLog
@@ -1,3 +1,7 @@
+2021-02-22 Phelype Oleinik <phe.h.o1@gmail.com>
+
+ * etex.ch: avoid "expansion depth" overflow with \numexpr.
+
2021-02-13 Karl Berry <karl@freefriends.org>
* am/etex.am (etex_ch_srcs): adjust for split enctex changes.
diff --git a/Build/source/texk/web2c/etexdir/etex.ch b/Build/source/texk/web2c/etexdir/etex.ch
index cf0d56c6479..d6363552633 100644
--- a/Build/source/texk/web2c/etexdir/etex.ch
+++ b/Build/source/texk/web2c/etexdir/etex.ch
@@ -5017,7 +5017,10 @@ var a,@!b:boolean; {saved values of |arith_error|}
@!p:pointer; {top of expression stack}
@!q:pointer; {for stack manipulations}
begin l:=cur_val_level; a:=arith_error; b:=false; p:=null;
+incr(expand_depth_count);
+if expand_depth_count>=expand_depth then overflow("expansion depth",expand_depth);
@<Scan and evaluate an expression |e| of type |l|@>;
+decr(expand_depth_count);
if b then
begin print_err("Arithmetic overflow");
@.Arithmetic overflow@>
diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog
index dc6402658e7..1506fd30a9e 100644
--- a/Build/source/texk/web2c/pdftexdir/ChangeLog
+++ b/Build/source/texk/web2c/pdftexdir/ChangeLog
@@ -1,3 +1,7 @@
+2021-02-22 Phelype Oleinik <phe.h.o1@gmail.com>
+
+ * eobase.ch: avoid "expansion depth" overflow with \numexpr.
+
2021-02-17 Karl Berry <karl@tug.org>
* NEWS,
diff --git a/Build/source/texk/web2c/pdftexdir/pdftex.web b/Build/source/texk/web2c/pdftexdir/pdftex.web
index 848b37976d7..4ae1f20716f 100644
--- a/Build/source/texk/web2c/pdftexdir/pdftex.web
+++ b/Build/source/texk/web2c/pdftexdir/pdftex.web
@@ -38618,7 +38618,10 @@ var a,@!b:boolean; {saved values of |arith_error|}
@!p:pointer; {top of expression stack}
@!q:pointer; {for stack manipulations}
begin l:=cur_val_level; a:=arith_error; b:=false; p:=null;
+incr(expand_depth_count);
+if expand_depth_count>=expand_depth then overflow("expansion depth",expand_depth);
@<Scan and evaluate an expression |e| of type |l|@>;
+decr(expand_depth_count);
if b then
begin print_err("Arithmetic overflow");
@.Arithmetic overflow@>
diff --git a/Build/source/texk/web2c/xetexdir/ChangeLog b/Build/source/texk/web2c/xetexdir/ChangeLog
index d68c003cc16..cfbdeaf80a9 100644
--- a/Build/source/texk/web2c/xetexdir/ChangeLog
+++ b/Build/source/texk/web2c/xetexdir/ChangeLog
@@ -1,3 +1,7 @@
+2021-02-22 Phelype Oleinik <phe.h.o1@gmail.com>
+
+ * eobase.ch: avoid "expansion depth" overflow with \numexpr.
+
2021-02-17 Karl Berry <karl@tug.org>
* NEWS,
diff --git a/Build/source/texk/web2c/xetexdir/xetex.web b/Build/source/texk/web2c/xetexdir/xetex.web
index 04e00da0152..8aa90220eb4 100644
--- a/Build/source/texk/web2c/xetexdir/xetex.web
+++ b/Build/source/texk/web2c/xetexdir/xetex.web
@@ -32966,7 +32966,10 @@ var a,@!b:boolean; {saved values of |arith_error|}
@!p:pointer; {top of expression stack}
@!q:pointer; {for stack manipulations}
begin l:=cur_val_level; a:=arith_error; b:=false; p:=null;
+incr(expand_depth_count);
+if expand_depth_count>=expand_depth then overflow("expansion depth",expand_depth);
@<Scan and evaluate an expression |e| of type |l|@>;
+decr(expand_depth_count);
if b then
begin print_err("Arithmetic overflow");
@.Arithmetic overflow@>