You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dogroups: don't access columns beyond end of table
Previously, dogroups() could try to read elements after the (resized)
end of over-allocated data.table list, expecting them to be NULL. This
didn't crash in practice, but is now explicitly checked for (and
disallowed).
error(_("Supplied %d items to be assigned to group %d of size %d in column '%s'. The RHS length must either be 1 (single values are ok) or match the LHS length exactly. If you wish to 'recycle' the RHS please use rep() explicitly to make this intent clear to readers of your code."),vlen,i+1,grpn,CHAR(colname));
313
313
// e.g. in #91 `:=` did not issue recycling warning during grouping. Now it is error not warning.
314
314
}
315
315
}
316
316
intn=LENGTH(VECTOR_ELT(dt, 0));
317
317
for (intj=0; j<length(lhs); ++j) {
318
318
intcolj=INTEGER(lhs)[j]-1;
319
-
target=VECTOR_ELT(dt, colj);
320
319
RHS=VECTOR_ELT(jval,j%LENGTH(jval));
321
-
if (isNull(target)) {
320
+
if (colj >= LENGTH(dt)) {
322
321
// first time adding to new column
323
322
if (R_maxLength(dt) <colj+1) internal_error(__func__, "Trying to add new column by reference but tl is full; setalloccol should have run first at R level before getting to this point"); // # nocov
0 commit comments