Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r242964 - Storing a Node in Ref/RefPtr inside its destructor re…
…sults in double delete https://bugs.webkit.org/show_bug.cgi?id=195661 Reviewed by Brent Fulgham. Set Node::m_refCount to 1 before calling its virtual destructor. This is a security mitigation to prevent any code which ends up storing the node to Ref / RefPtr inside the destructor, which is a programming error caught by debug assertions, from triggering a double-delete on the same Node. Such a code would hit the debug assertions in Node::deref() because m_inRemovedLastRefFunction had been set to true by then. * dom/Document.cpp: (WebCore::Document::removedLastRef): * dom/Document.h: (WebCore::Document::decrementReferencingNodeCount): * dom/Node.cpp: (WebCore::Node::~Node): (WebCore::Node::removedLastRef):
- Loading branch information
1 parent
0089d8a
commit 7f1db1b
Showing
4 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters