graphviz/graphviz-2.38.0-find-fix.patch
Jaroslav Škarvada 76b3124896 Fixed crash by adding additional check to findVertical/Horizontal functions
(by find-fix patch provided by Mattias Ellert <mattias.ellert@fysast.uu.se>)
  Resolves: rhbz#1095419
2014-05-28 15:30:46 +02:00

37 lines
897 B
Diff

From 2bd456d77bd035aadff61122868d02291f7898ea Mon Sep 17 00:00:00 2001
From: Mattias Ellert <mattias.ellert@fysast.uu.se>
Date: Wed, 28 May 2014 07:05:49 +0200
Subject: [PATCH] Break infinite recursion that leads to segfault.
---
lib/dotgen/compound.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/dotgen/compound.c b/lib/dotgen/compound.c
index ac78cd5..7156103 100644
--- a/lib/dotgen/compound.c
+++ b/lib/dotgen/compound.c
@@ -176,6 +176,9 @@ findVertical(pointf * pts, double tmin, double tmax,
double t;
int no_cross = countVertCross(pts, xcoord);
+ if (tmin >= tmax)
+ return -1.0;
+
if (no_cross == 0)
return -1.0;
@@ -214,6 +217,9 @@ findHorizontal(pointf * pts, double tmin, double tmax,
double t;
int no_cross = countHorzCross(pts, ycoord);
+ if (tmin >= tmax)
+ return -1.0;
+
if (no_cross == 0)
return -1.0;
--
1.9.3