File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
inst/include/Rcpp/internal Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 1+ 2026-03-26 Iñaki Ucar <iucar@fedoraproject.org>
2+
3+ * inst/include/Rcpp/internal/r_vector.h: Return null start for empty vectors
4+ instead of an invalid pointer, which causes UB in e.g. std::copy
5+
162026-03-06 Dirk Eddelbuettel <edd@debian.org>
27
38 * DESCRIPTION (Version, Date): Roll micro version and date (twice)
Original file line number Diff line number Diff line change 33//
44// r_vector.h: Rcpp R/C++ interface class library -- information about R vectors
55//
6- // Copyright (C) 2010 - 2017 Dirk Eddelbuettel and Romain Francois
6+ // Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain François
7+ // Copyright (C) 2026 Dirk Eddelbuettel, Romain François and Iñaki Ucar
78//
89// This file is part of Rcpp.
910//
@@ -36,6 +37,8 @@ typename Rcpp::traits::storage_type<RTYPE>::type* r_vector_start(SEXP x) {
3637#define RCPP_VECTOR_START_IMPL (__RTYPE__, __ACCESSOR__ ) \
3738 template <> \
3839 inline typename Rcpp::traits::storage_type<__RTYPE__>::type* r_vector_start<__RTYPE__>(SEXP x) { \
40+ if (Rf_xlength (x) == 0 ) \
41+ return NULL ; \
3942 return __ACCESSOR__ (x); \
4043 }
4144
You can’t perform that action at this time.
0 commit comments