summaryrefslogtreecommitdiff
path: root/pxl/pxstream.c
diff options
context:
space:
mode:
authorHenry Stiles <henry.stiles@artifex.com>2008-06-30 02:15:10 +0000
committerHenry Stiles <henry.stiles@artifex.com>2008-06-30 02:15:10 +0000
commit4c8a8697d1f6bcff4aba6530891eed76b74b4e19 (patch)
treedfec9f329eea47901bef12cf6cd2a6917ba29b4e /pxl/pxstream.c
parent2002fb6bcbdfef61e510a4453c78dae01f937551 (diff)
Ghostpcl revision 3094 exposed a new problem in the PCLXL cet, there
was no protection against infinite recursion of streams. This fixes the test file E601.bin which has shown up in regression reports since rev. 3094. git-svn-id: http://svn.ghostscript.com/ghostpcl/trunk/ghostpcl@3099 06663e23-700e-0410-b217-a244a6096597
Diffstat (limited to 'pxl/pxstream.c')
-rw-r--r--pxl/pxstream.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/pxl/pxstream.c b/pxl/pxstream.c
index b6d3b136b..a48168373 100644
--- a/pxl/pxstream.c
+++ b/pxl/pxstream.c
@@ -139,6 +139,10 @@ pxExecStream(px_args_t *par, px_state_t *pxs)
if ( code < 0 )
return code;
+
+ if ( pxs->stream_level > 32 )
+ return_error(errorStreamNestingFull);
+
{ bool found = pl_dict_find(&pxs->stream_dict, str.data, str.size,
&def);
@@ -175,7 +179,9 @@ pxExecStream(px_args_t *par, px_state_t *pxs)
st.last_operator = pst->last_operator;
r.ptr = start;
r.limit = def_data + def_size - 1;
+ pxs->stream_level++;
code = px_process(&st, pxs, &r);
+ pxs->stream_level--;
pst->macro_state = st.macro_state & ~ptsExecStream;
if ( code < 0 )
{ /* Set the operator counts for error reporting. */