Looks plausible to me. I guess we thought that immediately calling R_MakeExternalPtr would protect this, but the extension manual says that parameters should be protected on the caller side.
But I wonder how you found this: via manual inspection, by observing a use-after-free, or do you have a static check for this?
Looks plausible to me. I guess we thought that immediately calling
R_MakeExternalPtr
would protect this, but the extension manual says that parameters should be protected on the caller side.But I wonder how you found this: via manual inspection, by observing a use-after-free, or do you have a static check for this?