diff options
author | Luigi Scarso <luigi.scarso@gmail.com> | 2021-05-10 13:02:08 +0000 |
---|---|---|
committer | Luigi Scarso <luigi.scarso@gmail.com> | 2021-05-10 13:02:08 +0000 |
commit | 7be476b9aaffe6f6e987cfa0a492e857ed6418aa (patch) | |
tree | f7caf97148aa7aeaf635b59622f5d811976a6767 | |
parent | 456f2f75a738bd9118c2200ed6fe62fcf313f332 (diff) |
MetaPost: fixed the patch on the stack overflow.
git-svn-id: svn://tug.org/texlive/trunk@59158 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/web2c/luatexdir/luatex_svnversion.h | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/mplibdir/mp.w | 16 |
2 files changed, 8 insertions, 10 deletions
diff --git a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h index 883b2d562f3..b40380e1055 100644 --- a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h +++ b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h @@ -1 +1 @@ -#define luatex_svn_revision 7438 +#define luatex_svn_revision 7439 diff --git a/Build/source/texk/web2c/mplibdir/mp.w b/Build/source/texk/web2c/mplibdir/mp.w index acb64feed7f..469218c692b 100644 --- a/Build/source/texk/web2c/mplibdir/mp.w +++ b/Build/source/texk/web2c/mplibdir/mp.w @@ -18136,15 +18136,13 @@ new level (having, initially, the same properties as the old). @d push_input { /* enter a new input level, save the old */ if ( mp->input_ptr>mp->max_in_stack ) { mp->max_in_stack=mp->input_ptr; - /* The mp->stack_size < 1001 condition is necessary to prevent stack overflow due infinite recursion. */ - if ( mp->input_ptr==mp->stack_size && mp->stack_size < 1001) { - int l = (mp->stack_size+(mp->stack_size/4)); - XREALLOC(mp->input_stack, l, in_state_record); - mp->stack_size = l; - } else { - fprintf(stderr, "input stack overflow\n"); - exit(EXIT_FAILURE); - } + if ( mp->input_ptr==mp->stack_size ) { + int l = (mp->stack_size+(mp->stack_size/4)); + /* The mp->stack_size < 1001 condition is necessary to prevent C stack overflow due infinite recursion. */ + if (l>1000) {fprintf(stderr, "input stack overflow\n");exit(EXIT_FAILURE);} + XREALLOC(mp->input_stack, l, in_state_record); + mp->stack_size = l; + } } mp->input_stack[mp->input_ptr]=mp->cur_input; /* stack the record */ incr(mp->input_ptr); |