Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2026-03-26 Iñaki Ucar <iucar@fedoraproject.org>

* inst/include/Rcpp/internal/r_vector.h: Return null start for empty vectors
instead of an invalid pointer, which causes UB in e.g. std::copy

2026-03-06 Dirk Eddelbuettel <edd@debian.org>

* DESCRIPTION (Version, Date): Roll micro version and date (twice)
Expand Down
5 changes: 4 additions & 1 deletion inst/include/Rcpp/internal/r_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
//
// r_vector.h: Rcpp R/C++ interface class library -- information about R vectors
//
// Copyright (C) 2010 - 2017 Dirk Eddelbuettel and Romain Francois
// Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain François
// Copyright (C) 2026 Dirk Eddelbuettel, Romain François and Iñaki Ucar
//
// This file is part of Rcpp.
//
Expand Down Expand Up @@ -36,6 +37,8 @@ typename Rcpp::traits::storage_type<RTYPE>::type* r_vector_start(SEXP x) {
#define RCPP_VECTOR_START_IMPL(__RTYPE__, __ACCESSOR__) \
template <> \
inline typename Rcpp::traits::storage_type<__RTYPE__>::type* r_vector_start<__RTYPE__>(SEXP x) { \
if (Rf_xlength(x) == 0) \
return NULL; \
Comment thread
Enchufa2 marked this conversation as resolved.
Outdated
return __ACCESSOR__(x); \
}

Expand Down
Loading