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:
@@ -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;
|
||||
});
|
||||
|
Reference in New Issue
Block a user