summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ghostscript/ghostscript/CVE-2016-7977.patch
blob: b7eed1241e7a819515b01b9a831347a190632c7e (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
32
33
From 8abd22010eb4db0fb1b10e430d5f5d83e015ef70 Mon Sep 17 00:00:00 2001
From: Chris Liddell <chris.liddell@artifex.com>
Date: Mon, 3 Oct 2016 01:46:28 +0100
Subject: [PATCH] Bug 697169: Be rigorous with SAFER permissions

Once we've opened our input file from the command line, enforce the SAFER
rules.

Upstream-Status: Backport
CVE: CVE-2016-7977

Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
---
 psi/zfile.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/psi/zfile.c b/psi/zfile.c
index b6caea2..2c6c958 100644
--- a/psi/zfile.c
+++ b/psi/zfile.c
@@ -1081,6 +1081,9 @@ lib_file_open(gs_file_path_ptr  lib_path, const gs_memory_t *mem, i_ctx_t *i_ctx
     gs_main_instance *minst = get_minst_from_memory(mem);
     int code;
 
+    if (i_ctx_p && starting_arg_file)
+        i_ctx_p->starting_arg_file = false;
+
     /* when starting arg files (@ files) iodev_default is not yet set */
     if (iodev == 0)
         iodev = (gx_io_device *)gx_io_device_table[0];
-- 
2.10.2