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
This commit is contained in:
Jaroslav Škarvada 2014-05-28 15:30:46 +02:00
parent 71dfe05783
commit 76b3124896
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,36 @@
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

View File

@ -48,13 +48,14 @@
Name: graphviz
Summary: Graph Visualization Tools
Version: 2.38.0
Release: 4%{?dist}
Release: 5%{?dist}
Group: Applications/Multimedia
License: EPL
URL: http://www.graphviz.org/
Source0: http://www.graphviz.org/pub/graphviz/ARCHIVE/%{name}-%{version}.tar.gz
# Fix typo in testsuite (upstream ticket #2441).
Patch0: graphviz-2.38.0-rtest-fix.patch
Patch1: graphviz-2.38.0-find-fix.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: zlib-devel, libpng-devel, libjpeg-devel, expat-devel, freetype-devel >= 2
BuildRequires: ksh, bison, m4, flex, tk-devel, tcl-devel >= 8.3, swig
@ -258,6 +259,7 @@ Various tcl packages (extensions) for the graphviz tools.
%prep
%setup -q
%patch0 -p1 -b .rtest-fix
%patch1 -p1 -b .find-fix
# Attempt to fix rpmlint warnings about executable sources
find -type f -regex '.*\.\(c\|h\)$' -exec chmod a-x {} ';'
@ -547,6 +549,11 @@ rm -rf %{buildroot}
%changelog
* Wed May 28 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 2.38.0-5
- 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
* Tue May 20 2014 Jaroslav Škarvada <jskarvad@redhat.com> - 2.38.0-4
- Rebuilt for tcl/tk8.6