r-lib / rlang

Low-level API for programming with R
https://rlang.r-lib.org
Other
498 stars 136 forks source link

Protection issue in `clone2()` #1598

Closed DavisVaughan closed 1 year ago

DavisVaughan commented 1 year ago

attrs needs to be protected, as it is unprotected by the r_poke_attrib(x, r_null) call and then we allocate with r_clone()

https://github.com/r-lib/rlang/blob/60159c7c21031f87187f67fcf4c3f2145e6ee62e/src/rlang/attrib.c#L80-L90