summaryrefslogtreecommitdiff
path: root/app-text/ghostscript-gpl/files/VU332928-githash78911a01.patch
blob: 5d4dfde2fc3ae6db11f3228c0ea0699077c01977 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From: Chris Liddell <chris.liddell@artifex.com>
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");