mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
AK: Verify that m_impl is non-null in String::operator[]
This helps to find bugs where null strings are indexed into with operator[], as this would previously only report a RefPtr null dereference.
This commit is contained in:
parent
040d2479bf
commit
a557f83f8c
Notes:
sideshowbarker
2024-07-18 17:09:42 +09:00
Author: https://github.com/MaxWipfli Commit: https://github.com/SerenityOS/serenity/commit/a557f83f8c3 Pull-request: https://github.com/SerenityOS/serenity/pull/7593
1 changed files with 1 additions and 0 deletions
|
@ -160,6 +160,7 @@ public:
|
|||
|
||||
[[nodiscard]] ALWAYS_INLINE const char& operator[](size_t i) const
|
||||
{
|
||||
VERIFY(!is_null());
|
||||
return (*m_impl)[i];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue