mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
AK: Avoid nullptr deref in DeprecatedString(DeprecatedFlyString const&)
Prior to this commit, constructing a DS from a null DFS would cause a nullptr deref, which broke (at least) Profiler. This commit converts the null DFS to an empty DS, avoiding the nullptr deref (until DFS loses its null state, or we decide to not make it convertible to a DS).
This commit is contained in:
parent
a8f0fa5dd4
commit
867f7da017
Notes:
sideshowbarker
2024-07-17 10:39:39 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/867f7da017 Pull-request: https://github.com/SerenityOS/serenity/pull/21462 Reviewed-by: https://github.com/gmta ✅
1 changed files with 1 additions and 1 deletions
|
@ -374,7 +374,7 @@ DeprecatedString escape_html_entities(StringView html)
|
|||
}
|
||||
|
||||
DeprecatedString::DeprecatedString(DeprecatedFlyString const& string)
|
||||
: m_impl(*string.impl())
|
||||
: m_impl(*(string.impl() ?: &StringImpl::the_empty_stringimpl()))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue