1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +00:00

LibVT: Don't try to set the window title to invalid UTF-8 text

This commit is contained in:
Andreas Kling 2020-05-16 19:55:43 +02:00
parent b8498dc55e
commit fa712d8aa5

View file

@ -30,6 +30,7 @@
#include <AK/StdLibExtras.h>
#include <AK/String.h>
#include <AK/StringBuilder.h>
#include <AK/Utf8View.h>
#include <Kernel/KeyCode.h>
#include <LibCore/ConfigFile.h>
#include <LibCore/MimeData.h>
@ -408,6 +409,11 @@ void TerminalWidget::paint_event(GUI::PaintEvent& event)
void TerminalWidget::set_window_title(const StringView& title)
{
if (!Utf8View(title).validate()) {
dbg() << "TerminalWidget: Attempted to set window title to invalid UTF-8 string";
return;
}
if (on_title_change)
on_title_change(title);
}