From: Chris Liddell Date: Thu, 23 Aug 2018 08:54:59 +0000 (+0100) Subject: Bug 699654: Check the restore operand type X-Git-Tag: ghostpdl-9.24rc1~19 X-Git-Url: http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff_plain;h=78911a01 Bug 699654: Check the restore operand type The primary function that implements restore correctly checked its parameter, but a function that does some preliminary work for the restore (gstate and device handling) did not check. So, even though the restore correctly errored out, it left things partially done and, in particular, the device in partially restored state. Meaning the LockSafetyParams was not correctly set. --- diff --git a/psi/zdevice2.c b/psi/zdevice2.c index de16dd2..9fbb4e3 100644 --- a/psi/zdevice2.c +++ b/psi/zdevice2.c @@ -312,6 +312,9 @@ z2grestoreall(i_ctx_t *i_ctx_p) static int z2restore(i_ctx_t *i_ctx_p) { + os_ptr op = osp; + check_type(*op, t_save); + while (gs_gstate_saved(gs_gstate_saved(igs))) { if (restore_page_device(igs, gs_gstate_saved(igs))) return push_callout(i_ctx_p, "%restore1pagedevice");