Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upsetattr crashed when given empty character vector as name or value #2386
Comments
|
No repro on Win 7:
with
|
|
This managed to crash mine (same for character(0) in the other parameter): R version 3.4.1 (2017-06-30) data.table 1.10.4 |
|
I guess you should test on the development version before reporting here, per https://github.com/Rdatatable/data.table/wiki/Support |
|
Trying this with the R-devel version and latest data.table build does not reproduce. But here's the thing, I'm pretty sure this is dependent on what memory the uninitialized data is pointing to. Different builds might do different things. However, the bug I pointed out is still there and it is a simple code flow. |
|
I can crash with So, the only problem is when using Cheers, |
Trying to run setattr(numeric(1), "class", character(0)) or setattr(numeric(1), character(0), "value") crashes because the setattrib c function doesn't check if the value or name string vector actually has length > 0 before accessing it with STRING_ELT.