gnumeric r16950 - in trunk: . plugins/fn-stat



Author: mortenw
Date: Wed Nov  5 13:37:11 2008
New Revision: 16950
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16950&view=rev

Log:
2008-11-05  Morten Welinder  <terra gnome org>

	* functions.c (gnumeric_growth, gnumeric_trend): Fix crasher
	#559363.



Modified:
   trunk/NEWS
   trunk/plugins/fn-stat/ChangeLog
   trunk/plugins/fn-stat/functions.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Wed Nov  5 13:37:11 2008
@@ -24,6 +24,7 @@
 	* Fix RANDDISCRETE crash.  [#557682]
 	* Fix SUMIF issues.  [#557782]
 	* Fix LOOKUP critical.  [#559005]
+	* Fix GROWTH/TREND crash.  [#559363]
 
 --------------------------------------------------------------------------
 Gnumeric 1.9.3

Modified: trunk/plugins/fn-stat/functions.c
==============================================================================
--- trunk/plugins/fn-stat/functions.c	(original)
+++ trunk/plugins/fn-stat/functions.c	Wed Nov  5 13:37:11 2008
@@ -4602,6 +4602,11 @@
 		goto out;
 	}
 
+	if (nnx <= 0) {
+		result = value_new_error_VALUE (ei->pos);
+		goto out;
+	}
+
 	dim = 1;
 
 	if (gnm_linear_regression (&xs, dim, ys, nx, affine, linres, NULL) !=
@@ -4968,6 +4973,11 @@
 		goto out;
 	}
 
+	if (nnx <= 0) {
+		result = value_new_error_VALUE (ei->pos);
+		goto out;
+	}
+
 	dim = 1;
 
 	if (gnm_exponential_regression (&xs, dim,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]