ghostscript/ghostscript-9.20-cve-2016-10217.patch
2017-04-27 17:58:32 +02:00

34 lines
1.3 KiB
Diff

From 90fd0c7ca3efc1ddff64a86f4104b13b3ac969eb Mon Sep 17 00:00:00 2001
From: Michael Vrhel <michael.vrhel@artifex.com>
Date: Thu, 29 Dec 2016 14:00:21 -0800
Subject: [PATCH] Bug 697456. Dont create new ctx when pdf14 device reenabled
This bug had yet another weird case where the user created a
file that pushed the pdf14 device twice. We were in that case,
creating a new ctx and blowing away the original one with out
proper clean up. To avoid, only create a new one when we need it.
---
base/gdevp14.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/base/gdevp14.c b/base/gdevp14.c
index fd56ec9..f19318e 100644
--- a/base/gdevp14.c
+++ b/base/gdevp14.c
@@ -1669,8 +1669,10 @@ pdf14_open(gx_device *dev)
rect.p.y = 0;
rect.q.x = dev->width;
rect.q.y = dev->height;
- pdev->ctx = pdf14_ctx_new(&rect, dev->color_info.num_components,
- pdev->color_info.polarity != GX_CINFO_POLARITY_SUBTRACTIVE, dev);
+ /* If we are reenabling the device dont create a new ctx. Bug 697456 */
+ if (pdev->ctx == NULL)
+ pdev->ctx = pdf14_ctx_new(&rect, dev->color_info.num_components,
+ pdev->color_info.polarity != GX_CINFO_POLARITY_SUBTRACTIVE, dev);
if (pdev->ctx == NULL)
return_error(gs_error_VMerror);
pdev->free_devicen = true;
--
2.9.3