mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
HackStudio: Avoid UAF when loading the GML preview
The value returned by editor().text() was a temporarily allocated string which we were holding a view into.
This commit is contained in:
parent
decc00dcdf
commit
e57d739705
1 changed files with 1 additions and 1 deletions
|
@ -1699,7 +1699,7 @@ bool HackStudioWidget::any_document_is_dirty() const
|
||||||
|
|
||||||
void HackStudioWidget::update_gml_preview()
|
void HackStudioWidget::update_gml_preview()
|
||||||
{
|
{
|
||||||
auto gml_content = current_editor_wrapper().filename().ends_with(".gml"sv) ? current_editor_wrapper().editor().text().view() : ""sv;
|
auto gml_content = current_editor_wrapper().filename().ends_with(".gml"sv) ? current_editor_wrapper().editor().text() : ByteString::empty();
|
||||||
m_gml_preview_widget->load_gml(gml_content);
|
m_gml_preview_widget->load_gml(gml_content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue