summaryrefslogtreecommitdiff
path: root/dom/base/nsTreeSanitizer.cpp
diff options
context:
space:
mode:
authorOlli Pettay <Olli.Pettay@helsinki.fi>2016-11-16 23:37:41 +0100
committerPale Moon <git-repo@palemoon.org>2016-11-16 23:37:41 +0100
commitafaa122df5a839ccf1e5c6cd8f6ce548c35fc741 (patch)
tree366c1e2313c37169cb9f429bab28c5f2d56a49c2 /dom/base/nsTreeSanitizer.cpp
parentb612ef8d8a97d340bef2a849b1c41edfac07f8ff (diff)
downloadpalemoon-gre-afaa122df5a839ccf1e5c6cd8f6ce548c35fc741.tar.gz
Ensure expected DOM tree operations when calling insertBefore.
Diffstat (limited to 'dom/base/nsTreeSanitizer.cpp')
-rw-r--r--dom/base/nsTreeSanitizer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/dom/base/nsTreeSanitizer.cpp b/dom/base/nsTreeSanitizer.cpp
index 737bc46ff..f407585a7 100644
--- a/dom/base/nsTreeSanitizer.cpp
+++ b/dom/base/nsTreeSanitizer.cpp
@@ -1433,7 +1433,8 @@ nsTreeSanitizer::SanitizeChildren(nsINode* aRoot)
nsCOMPtr<nsIContent> child; // Must keep the child alive during move
ErrorResult rv;
while ((child = node->GetFirstChild())) {
- parent->InsertBefore(*child, node, rv);
+ nsCOMPtr<nsINode> refNode = node;
+ parent->InsertBefore(*child, refNode, rv);
if (rv.Failed()) {
break;
}