aboutsummaryrefslogtreecommitdiffstats
path: root/main/ghostscript/CVE-2017-7207.patch
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2017-05-30 06:51:08 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2017-05-30 12:18:35 +0000
commit0d31fbd835bf00e76c6af48139c8f30e9ee0d095 (patch)
treefd0048a2053d2970312ce40224d9229ea981ffc3 /main/ghostscript/CVE-2017-7207.patch
parente88b188c74342100d25b8824eaa97c40dd9d2ac8 (diff)
downloadaports-0d31fbd835bf00e76c6af48139c8f30e9ee0d095.tar.bz2
aports-0d31fbd835bf00e76c6af48139c8f30e9ee0d095.tar.xz
main/ghostscript: security fixes (fix CVE-2017-5951, CVE-2017-7207). Fixes #7309
Diffstat (limited to 'main/ghostscript/CVE-2017-7207.patch')
-rw-r--r--main/ghostscript/CVE-2017-7207.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/main/ghostscript/CVE-2017-7207.patch b/main/ghostscript/CVE-2017-7207.patch
new file mode 100644
index 0000000000..0cfa5942be
--- /dev/null
+++ b/main/ghostscript/CVE-2017-7207.patch
@@ -0,0 +1,33 @@
+From 309eca4e0a31ea70dcc844812691439312dad091 Mon Sep 17 00:00:00 2001
+From: Ken Sharp <ken.sharp@artifex.com>
+Date: Mon, 20 Mar 2017 09:34:11 +0000
+Subject: [PATCH] Ensure a device has raster memory, before trying to read it.
+
+Bug #697676 "Null pointer dereference in mem_get_bits_rectangle()"
+
+This is only possible by abusing/mis-using Ghostscript-specific
+language extensions, so cannot happen in a general PostScript program.
+
+Nevertheless, Ghostscript should not crash. So this commit checks the
+memory device to see if raster memory has been allocated, before trying
+to read from it.
+---
+ base/gdevmem.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/base/gdevmem.c b/base/gdevmem.c
+index afd05bd..d52d684 100644
+--- a/base/gdevmem.c
++++ b/base/gdevmem.c
+@@ -606,6 +606,8 @@ mem_get_bits_rectangle(gx_device * dev, const gs_int_rect * prect,
+ GB_PACKING_CHUNKY | GB_COLORS_NATIVE | GB_ALPHA_NONE;
+ return_error(gs_error_rangecheck);
+ }
++ if (mdev->line_ptrs == 0x00)
++ return_error(gs_error_rangecheck);
+ if ((w <= 0) | (h <= 0)) {
+ if ((w | h) < 0)
+ return_error(gs_error_rangecheck);
+--
+2.9.1
+