summaryrefslogtreecommitdiff
path: root/psi/zcrd.c
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2018-11-14 09:31:10 +0000
committerKen Sharp <ken.sharp@artifex.com>2018-11-14 10:03:45 +0000
commit9a1b3ac61761094713f44dedfce56013308a3b1d (patch)
treef2fb67c659c5e898f98ef11c362d3f430add25f3 /psi/zcrd.c
parent606a22e77e7f081781e99e44644cd0119f559e03 (diff)
downloadghostpdl-9a1b3ac61761094713f44dedfce56013308a3b1d.tar.gz
PS interpreter - add some type checking
These were 'probably' safe anyway, since they mostly treat the objects as integers without checking, which at least can't result in a crash. Nevertheless, we ought to check. The return from comparedictkeys could be wrong if one of the keys had a value which was not an array, it could incorrectly decide the two were in fact the same.
Diffstat (limited to 'psi/zcrd.c')
-rw-r--r--psi/zcrd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/psi/zcrd.c b/psi/zcrd.c
index 7993b1544..d58160d89 100644
--- a/psi/zcrd.c
+++ b/psi/zcrd.c
@@ -231,8 +231,10 @@ zcrd1_params(os_ptr op, gs_cie_render * pcrd,
return code;
if (dict_find_string(op, "RenderTable", &pRT) > 0) {
- const ref *prte = pRT->value.const_refs;
+ const ref *prte;
+ check_read_type(*pRT, t_array);
+ prte = pRT->value.const_refs;
/* Finish unpacking and checking the RenderTable parameter. */
check_type_only(prte[4], t_integer);
if (!(prte[4].value.intval == 3 || prte[4].value.intval == 4))