[Rcpp-commits] r4047 - in pkg/Rcpp: . debian inst inst/include/Rcpp/iostream

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Nov 27 15:21:42 CET 2012


Author: edd
Date: 2012-11-27 15:21:42 +0100 (Tue, 27 Nov 2012)
New Revision: 4047

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/debian/changelog
   pkg/Rcpp/inst/NEWS.Rd
   pkg/Rcpp/inst/include/Rcpp/iostream/Rostream.h
Log:
fix potential segfault in Rstreambuf deletion


Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2012-11-27 01:34:59 UTC (rev 4046)
+++ pkg/Rcpp/ChangeLog	2012-11-27 14:21:42 UTC (rev 4047)
@@ -1,3 +1,7 @@
+2012-11-27  Dirk Eddelbuettel  <edd at debian.org>
+
+	* inst/include/Rcpp/iostream/Rostream.h: Check before deleting buf
+
 2012-11-26  Dirk Eddelbuettel  <edd at debian.org>
 
         * DESCRIPTION: Release 0.10.1

Modified: pkg/Rcpp/debian/changelog
===================================================================
--- pkg/Rcpp/debian/changelog	2012-11-27 01:34:59 UTC (rev 4046)
+++ pkg/Rcpp/debian/changelog	2012-11-27 14:21:42 UTC (rev 4047)
@@ -1,8 +1,11 @@
 rcpp (0.10.1-1) unstable; urgency=low
 
   * New release
+  
+  * inst/include/Rcpp/iostream/Rostream.h: Additional fix that didn't make
+    into 0.10.1
 
- -- Dirk Eddelbuettel <edd at debian.org>  Mon, 26 Nov 2012 18:39:55 -0600
+ -- Dirk Eddelbuettel <edd at debian.org>  Tue, 27 Nov 2012 08:20:54 -0600
 
 rcpp (0.10.0-1) unstable; urgency=low
 

Modified: pkg/Rcpp/inst/NEWS.Rd
===================================================================
--- pkg/Rcpp/inst/NEWS.Rd	2012-11-27 01:34:59 UTC (rev 4046)
+++ pkg/Rcpp/inst/NEWS.Rd	2012-11-27 14:21:42 UTC (rev 4047)
@@ -2,6 +2,15 @@
 \title{News for Package 'Rcpp'}
 \newcommand{\cpkg}{\href{http://CRAN.R-project.org/package=#1}{\pkg{#1}}}
 
+\section{Changes in Rcpp version 0.10.2 (future)}{
+  \itemize{
+    \item Changes in Rcpp API:
+    \itemize{
+      \item Added additional check in Rstreambuf deletetion
+    }
+  }
+}
+
 \section{Changes in Rcpp version 0.10.1 (2012-11-26)}{
     \itemize{
         \item Changes in Rcpp sugar: 

Modified: pkg/Rcpp/inst/include/Rcpp/iostream/Rostream.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/iostream/Rostream.h	2012-11-27 01:34:59 UTC (rev 4046)
+++ pkg/Rcpp/inst/include/Rcpp/iostream/Rostream.h	2012-11-27 14:21:42 UTC (rev 4047)
@@ -38,7 +38,12 @@
             std::ostream( new Rstreambuf(output) ), 
             buf( static_cast<Rstreambuf*>( rdbuf() ) )
         {}
-        ~Rostream(){ delete buf ; }
+        ~Rostream() { 
+            if (buf != NULL) {
+                delete buf; 
+                buf = NULL;
+            }
+        }
     };
     
     // declare global variable



More information about the Rcpp-commits mailing list