summaryrefslogtreecommitdiff
path: root/print/ghostscript-gpl/patches/patch-CVE-2016-10219
blob: 8a48247a4f1082fabebf1ae9ff14c39d8f6c5dc6 (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
$NetBSD: patch-CVE-2016-10219,v 1.1 2017/04/18 22:07:07 tez Exp $

Patch for CVE-2016-10219 from
http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=4bef1a1d32e29b68855616020dbff574b9cda08f;hp=0aeb0bbd41cc16e70ab6e4b1d56e0c510bf2a758


--- base/gxfill.c.orig	2017-04-05 20:56:07.869067200 +0000
+++ base/gxfill.c
@@ -1743,7 +1743,7 @@ intersect(active_line *endp, active_line
     fixed dx_old = alp->x_current - endp->x_current;
     fixed dx_den = dx_old + endp->x_next - alp->x_next;
 
-    if (dx_den <= dx_old)
+    if (dx_den <= dx_old || dx_den == 0)
         return false; /* Intersection isn't possible. */
     dy = y1 - y;
     if_debug3('F', "[F]cross: dy=%g, dx_old=%g, dx_new=%g\n",
@@ -1752,7 +1752,7 @@ intersect(active_line *endp, active_line
     /* Do the computation in single precision */
     /* if the values are small enough. */
     y_new =
-        ((dy | dx_old) < 1L << (size_of(fixed) * 4 - 1) ?
+        (((ufixed)(dy | dx_old)) < (1L << (size_of(fixed) * 4 - 1)) ?
          dy * dx_old / dx_den :
          (INCR_EXPR(mq_cross), fixed_mult_quo(dy, dx_old, dx_den)))
         + y;