Skip to content

Commit a339dd8

Browse files
committed
tiledb_attr raises std::bad_alloc with variable length
1 parent 2e7e171 commit a339dd8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/libtiledb.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,6 +1517,10 @@ XPtr<tiledb::Attribute> libtiledb_attribute(XPtr<tiledb::Context> ctx,
15171517
if (ncells < 1 && ncells != R_NaInt) {
15181518
Rcpp::stop("ncells must be >= 1 (or NA for variable cells)");
15191519
}
1520+
if (ncells == R_NaInt) {
1521+
ncells = TILEDB_VAR_NUM;
1522+
}
1523+
15201524
// placeholder, overwritten in all branches below
15211525
XPtr<tiledb::Attribute> attr =
15221526
XPtr<tiledb::Attribute>(static_cast<tiledb::Attribute *>(nullptr));

0 commit comments

Comments
 (0)