mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02: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:
Notes:
sideshowbarker
2024-07-17 08:27:05 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/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 ✅
@@ -0,0 +1,13 @@
|
||||
<body>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
let observer = new MutationObserver(function() {});
|
||||
observer.observe(document.body, { attributes: true, childList: true, subtree: true });
|
||||
|
||||
let div = document.createElement("div");
|
||||
document.body.appendChild(div);
|
||||
div.remove();
|
||||
println("PASS! (Didn't crash)");
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user