summaryrefslogtreecommitdiff
path: root/app-text/ghostscript-gpl/files/VU332928-githashb326a716.patch
blob: 2c8533fa765191827cbae2793183c61c56cc7da3 (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
From: Chris Liddell <chris.liddell@artifex.com>
Date: Tue, 21 Aug 2018 15:24:05 +0000 (+0100)
Subject: Bug 699655: Properly check the return value....
X-Git-Tag: ghostpdl-9.24rc1~24
X-Git-Url: http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff_plain;h=b326a716

Bug 699655: Properly check the return value....

...when getting a value from a dictionary
---

diff --git a/psi/zcolor.c b/psi/zcolor.c
index 4c0f258..e27baf9 100644
--- a/psi/zcolor.c
+++ b/psi/zcolor.c
@@ -283,8 +283,9 @@ zsetcolor(i_ctx_t * i_ctx_p)
         if (r_has_type(op, t_dictionary)) {
             ref     *pImpl, pPatInst;
 
-            code = dict_find_string(op, "Implementation", &pImpl);
-            if (code != 0) {
+            if ((code = dict_find_string(op, "Implementation", &pImpl)) < 0)
+                return code;
+            if (code > 0) {
                 code = array_get(imemory, pImpl, 0, &pPatInst);
                 if (code < 0)
                     return code;