1
1

Fix: Use after free in spreadsheet attribute column ID

A temporary string was created in the attribute_foreach callback
and used in a map at a higher scope. When the callback finished,
the string went out of scope, was freed, then the elements in the
set pointed to freed memory.
This commit is contained in:
2021-09-14 18:13:52 -05:00
parent 7c7348f78d
commit e6fa74ffed

View File

@@ -54,8 +54,7 @@ void GeometryDataSource::foreach_default_column_ids(
return true;
}
SpreadsheetColumnID column_id;
std::string name = attribute_id.name();
column_id.name = (char *)name.c_str();
column_id.name = (char *)attribute_id.name().data();
fn(column_id);
return true;
});