From 4bc83e245411385923b4eaec536492c72030272c Mon Sep 17 00:00:00 2001 From: Bernd Zeimetz Date: Sun, 24 Feb 2008 16:18:24 +0100 Subject: [PATCH] =?utf8?q?=20=20-=20Adding=20debian/patches/bts428778-floa?= =?utf8?q?ting-point-exception=20to=20fix=20a=20corner=20=20=20=20=20case?= =?utf8?q?=20that=20produces=20a=20SIGFPE=20(Closes:=20#428778).=20Patch?= =?utf8?q?=20created=20by=20=20=20=20=20David=20Mart=C3=ADnez=20Moreno.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- debian/changelog | 5 ++++- .../bts428778-floating-point-exception | 20 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 debian/patches/bts428778-floating-point-exception diff --git a/debian/changelog b/debian/changelog index d810f9d..2d55cd2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,8 +5,11 @@ rrdtool (1.2.27-1) unstable; urgency=low - Install rrdtool's ttf and configure rrd to use it. * debian/patches: - Updating patches to apply on 1.2.27. + - Adding debian/patches/bts428778-floating-point-exception to fix a corner + case that produces a SIGFPE (Closes: #428778). Patch created by + David Martínez Moreno. - -- Bernd Zeimetz Sun, 24 Feb 2008 14:52:21 +0100 + -- Bernd Zeimetz Sun, 24 Feb 2008 16:15:04 +0100 rrdtool (1.2.26-1) unstable; urgency=low diff --git a/debian/patches/bts428778-floating-point-exception b/debian/patches/bts428778-floating-point-exception new file mode 100644 index 0000000..41d3756 --- /dev/null +++ b/debian/patches/bts428778-floating-point-exception @@ -0,0 +1,20 @@ +Index: rrdtool/src/rrd_create.c +=================================================================== +--- rrdtool.orig/src/rrd_create.c 2008-02-24 16:12:49.000000000 +0100 ++++ rrdtool/src/rrd_create.c 2008-02-24 16:13:34.000000000 +0100 +@@ -619,6 +619,15 @@ + default: + /* can not be zero because we don't know anything ... */ + rrd->cdp_prep->scratch[CDP_val].u_val = DNAN; ++ /* If the step is 0, we're going to have a BIG Floating Point Exception (i.e. SIGFPE). */ ++ /* Example: (( 1202705167 - 67 ) % ( 300 * 0 )) / 300 */ ++ if (rrd->rra_def[i].pdp_cnt == 0) ++ { ++ rrd_set_error("Invalid step: must be greater than 0."); ++ rrd_free(rrd); ++ fclose(rrd_file); ++ return(-1); ++ } + /* startup missing pdp count */ + rrd->cdp_prep->scratch[CDP_unkn_pdp_cnt].u_cnt = + ((rrd->live_head->last_up - diff --git a/debian/patches/series b/debian/patches/series index 8648bac..69cecaa 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ +bts428778-floating-point-exception setup.py-module-name no-rpath-for-ruby no-rpath-for-perl -- 2.30.2