summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ghostscript/ghostscript/CVE-2016-10219.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/ghostscript/ghostscript/CVE-2016-10219.patch')
-rw-r--r--meta/recipes-extended/ghostscript/ghostscript/CVE-2016-10219.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-extended/ghostscript/ghostscript/CVE-2016-10219.patch b/meta/recipes-extended/ghostscript/ghostscript/CVE-2016-10219.patch
new file mode 100644
index 0000000000..574abe0e42
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/CVE-2016-10219.patch
@@ -0,0 +1,49 @@
1From 4bef1a1d32e29b68855616020dbff574b9cda08f Mon Sep 17 00:00:00 2001
2From: Robin Watts <Robin.Watts@artifex.com>
3Date: Thu, 29 Dec 2016 15:57:43 +0000
4Subject: [PATCH] Bug 697453: Avoid divide by 0 in scan conversion code.
5
6Arithmetic overflow due to extreme values in the scan conversion
7code can cause a division by 0.
8
9Avoid this with a simple extra check.
10
11 dx_old=cf814d81
12 endp->x_next=b0e859b9
13 alp->x_next=8069a73a
14
15leads to dx_den = 0
16
17Upstream-Status: Backport
18CVE: CVE-2016-10219
19
20Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
21---
22 base/gxfill.c | 4 ++--
23 1 file changed, 2 insertions(+), 2 deletions(-)
24
25diff --git a/base/gxfill.c b/base/gxfill.c
26index 99196c0..2f81bb0 100644
27--- a/base/gxfill.c
28+++ b/base/gxfill.c
29@@ -1741,7 +1741,7 @@ intersect(active_line *endp, active_line *alp, fixed y, fixed y1, fixed *p_y_new
30 fixed dx_old = alp->x_current - endp->x_current;
31 fixed dx_den = dx_old + endp->x_next - alp->x_next;
32
33- if (dx_den <= dx_old)
34+ if (dx_den <= dx_old || dx_den == 0)
35 return false; /* Intersection isn't possible. */
36 dy = y1 - y;
37 if_debug3('F', "[F]cross: dy=%g, dx_old=%g, dx_new=%g\n",
38@@ -1750,7 +1750,7 @@ intersect(active_line *endp, active_line *alp, fixed y, fixed y1, fixed *p_y_new
39 /* Do the computation in single precision */
40 /* if the values are small enough. */
41 y_new =
42- ((dy | dx_old) < 1L << (size_of(fixed) * 4 - 1) ?
43+ (((ufixed)(dy | dx_old)) < (1L << (size_of(fixed) * 4 - 1)) ?
44 dy * dx_old / dx_den :
45 (INCR_EXPR(mq_cross), fixed_mult_quo(dy, dx_old, dx_den)))
46 + y;
47--
482.10.2
49