Skip to content

Conversation

@MichaelChirico
Copy link
Contributor

We recently found some bad code using R_MakeExternalPtr(p, nullptr, nullptr) (C++ "equivalent" of NULL) which could trigger a segfault via object.size() of an object including the incorrectly-initialized externalptr.

https://cran.r-project.org/doc/manuals/r-devel/R-exts.html#External-pointers-and-weak-references-1

tag is an SEXP, so the R NULL is better than the C NULL.

cc @randy3k

Copy link
Member

@paleolimbot paleolimbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@paleolimbot paleolimbot merged commit 090b85e into apache:main Jan 27, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants