From 9a1b3ac61761094713f44dedfce56013308a3b1d Mon Sep 17 00:00:00 2001 From: Ken Sharp Date: Wed, 14 Nov 2018 09:31:10 +0000 Subject: 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. --- psi/zcrd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'psi/zcrd.c') 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)) -- cgit v1.2.1