mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibWeb: Fix null pointer dereference in DOM::Node::remove()
Instead of blindly dereferencing m_registered_observer_list, just use the add_registered_observer() helper. Fixes #22005
This commit is contained in:
parent
7320fdc1f5
commit
cc9de38ea4
Notes:
sideshowbarker
2024-07-17 08:27:05 +09:00
Author: https://github.com/awesomekling
Commit: cc9de38ea4
Pull-request: https://github.com/SerenityOS/serenity/pull/22007
Issue: https://github.com/SerenityOS/serenity/issues/22005
Reviewed-by: https://github.com/Lubrsi ✅
3 changed files with 15 additions and 1 deletions
|
@ -693,7 +693,7 @@ void Node::remove(bool suppress_observers)
|
|||
for (auto& registered : *inclusive_ancestor->m_registered_observer_list) {
|
||||
if (registered->options().subtree) {
|
||||
auto transient_observer = TransientRegisteredObserver::create(registered->observer(), registered->options(), registered);
|
||||
m_registered_observer_list->append(move(transient_observer));
|
||||
add_registered_observer(move(transient_observer));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue