blob: 02b1dc962f0f32b5dafa92b84b11e398c5ef1cbe [file] [log] [blame]
Brad Bishopd89cb5f2019-04-10 09:02:41 -04001From 60b77b8bf8b6e4d30519c47724631012b530cf0e Mon Sep 17 00:00:00 2001
2From: Chris Liddell <chris.liddell@artifex.com>
3Date: Sat, 15 Dec 2018 09:08:32 +0000
4Subject: [PATCH 3/7] Bug700317: Fix logic for an older change
5
6Unlike almost every other function in gs, dict_find_string() returns 1 on
7success 0 or <0 on failure. The logic for this case was wrong.
8
9CVE: CVE-2019-6116
10Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git]
11
12Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
13---
14 psi/interp.c | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/psi/interp.c b/psi/interp.c
18index aa5779c..f6c45bb 100644
19--- a/psi/interp.c
20+++ b/psi/interp.c
21@@ -703,7 +703,7 @@ again:
22 * i.e. it's an internal operator we have hidden
23 */
24 code = dict_find_string(systemdict, (const char *)bufptr, &tobj);
25- if (code < 0) {
26+ if (code <= 0) {
27 buf[0] = buf[1] = buf[rlen + 2] = buf[rlen + 3] = '-';
28 rlen += 4;
29 bufptr = buf;
30--
312.18.1
32