summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2017-04-27 13:03:33 +0100
committerChris Liddell <chris.liddell@artifex.com>2017-04-27 16:28:43 +0100
commit4f83478c88c2e05d6e8d79ca4557eb039354d2f3 (patch)
treec6d3f92173e2b02c76ab8f620c5b922d2a750981
parent5603e8fc3e59c435318877efe627967ee6baebb8 (diff)
Bug 697799: have .eqproc check its parameters
The Ghostscript custom operator .eqproc was not check the number or type of the parameters it was given.
-rw-r--r--psi/zmisc3.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/psi/zmisc3.c b/psi/zmisc3.c
index 54b304246..37293ff4b 100644
--- a/psi/zmisc3.c
+++ b/psi/zmisc3.c
@@ -56,6 +56,12 @@ zeqproc(i_ctx_t *i_ctx_p)
56 ref2_t stack[MAX_DEPTH + 1]; 56 ref2_t stack[MAX_DEPTH + 1];
57 ref2_t *top = stack; 57 ref2_t *top = stack;
58 58
59 if (ref_stack_count(&o_stack) < 2)
60 return_error(gs_error_stackunderflow);
61 if (!r_is_array(op - 1) || !r_is_array(op)) {
62 return_error(gs_error_typecheck);
63 }
64
59 make_array(&stack[0].proc1, 0, 1, op - 1); 65 make_array(&stack[0].proc1, 0, 1, op - 1);
60 make_array(&stack[0].proc2, 0, 1, op); 66 make_array(&stack[0].proc2, 0, 1, op);
61 for (;;) { 67 for (;;) {