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:
Hans Goudey 2021-09-14 18:13:52 -05:00
parent 7c7348f78d
commit e6fa74ffed
Notes: blender-bot 2023-02-14 05:28:01 +01:00
Referenced by issue #89045, VSE playback periodically refuses to work (Pulseaudio, OpenAL seems fine)
1 changed files with 1 additions and 2 deletions

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;
});