mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 20:45:14 +00:00
LibGemini: Fix crash on Link lines without explicit link text
Link::Link() does: if (m_name.is_null()) m_name = m_url.to_string(); This tries to set the link text to the link url if there's no explicit link text, but m_url.to_string() returns a temporary string object, and m_name was a StringView, so this ended pointing to invalid memory. This made the converted HTML contain garbage data as link text, which made LibWeb crash. (LibWeb probably shouldn't crash on links with garbage link text, but in this case it helped identify a bug, so let's keep that crash around since real web pages won't trigger it and it's kind of useful to find bugs like this one.) Makes gemini://rawtext.club/ no longer crash Browser.
This commit is contained in:
parent
fa5217ff4f
commit
21ac343211
Notes:
sideshowbarker
2024-07-19 02:00:33 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/21ac3432113 Pull-request: https://github.com/SerenityOS/serenity/pull/3701
1 changed files with 1 additions and 1 deletions
|
@ -89,7 +89,7 @@ public:
|
|||
|
||||
private:
|
||||
URL m_url;
|
||||
StringView m_name;
|
||||
String m_name;
|
||||
};
|
||||
|
||||
class Preformatted : public Line {
|
||||
|
|
Loading…
Add table
Reference in a new issue