[Dplr-commits] r859 - in pkg/dplR: . src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 6 08:36:53 CEST 2014


Author: mvkorpel
Date: 2014-05-06 08:36:53 +0200 (Tue, 06 May 2014)
New Revision: 859

Modified:
   pkg/dplR/ChangeLog
   pkg/dplR/src/readloop.c
Log:
Robustness of read.tucson() improved in case of unlikely input data

Modified: pkg/dplR/ChangeLog
===================================================================
--- pkg/dplR/ChangeLog	2014-05-06 06:17:41 UTC (rev 858)
+++ pkg/dplR/ChangeLog	2014-05-06 06:36:53 UTC (rev 859)
@@ -6,10 +6,11 @@
 - Bug fix: make.plot=TRUE threw an error when input data.frame had leading
   or trailing all-NA rows
 
-File: rcompact.c
-----------------
+Files: rcompact.c, readloop.c
+-----------------------------
 
-- Made the C code of read.compact() more resilient to unusual inputs
+- Made the C code of read.compact() and read.tucson() more
+  resilient to unusual inputs
 
 File: redfit.c
 --------------

Modified: pkg/dplR/src/readloop.c
===================================================================
--- pkg/dplR/src/readloop.c	2014-05-06 06:17:41 UTC (rev 858)
+++ pkg/dplR/src/readloop.c	2014-05-06 06:36:53 UTC (rev 859)
@@ -66,6 +66,8 @@
 	}
     }
     if (max_year >= min_year) {
+	if (max_year >= 0 && min_year < max_year - R_INT_MAX + 1)
+	    error(_("Number of years exceeds integer range"));
 	span = max_year - min_year + 1;
     } else {
 	min_year = NA_INTEGER;



More information about the Dplr-commits mailing list