Brad Bishop | d89cb5f | 2019-04-10 09:02:41 -0400 | [diff] [blame^] | 1 | From 60b77b8bf8b6e4d30519c47724631012b530cf0e Mon Sep 17 00:00:00 2001 |
| 2 | From: Chris Liddell <chris.liddell@artifex.com> |
| 3 | Date: Sat, 15 Dec 2018 09:08:32 +0000 |
| 4 | Subject: [PATCH 3/7] Bug700317: Fix logic for an older change |
| 5 | |
| 6 | Unlike almost every other function in gs, dict_find_string() returns 1 on |
| 7 | success 0 or <0 on failure. The logic for this case was wrong. |
| 8 | |
| 9 | CVE: CVE-2019-6116 |
| 10 | Upstream-Status: Backport [git://git.ghostscript.com/ghostpdl.git] |
| 11 | |
| 12 | Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> |
| 13 | --- |
| 14 | psi/interp.c | 2 +- |
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 16 | |
| 17 | diff --git a/psi/interp.c b/psi/interp.c |
| 18 | index 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 | -- |
| 31 | 2.18.1 |
| 32 | |