[prev in list] [next in list] [prev in thread] [next in thread] 

List:       konq-bugs
Subject:    [Bug 92066] testcase: konqueror crashes in replaceChild()
From:       Pascal "Létourneau" <pletourn () globetrotter ! net>
Date:       2004-10-30 19:31:33
Message-ID: 20041030193133.23263.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
        
http://bugs.kde.org/show_bug.cgi?id=92066        
pletourn globetrotter net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From pletourn globetrotter net  2004-10-30 21:31 -------
CVS commit by pletourn: 

Prevent a crash in replaceChildren(c1,c2) when c1,c2 are near sibling
Prevent a crash in removeChildren() by reiniting _first earlier
BUG:92066
CCBUG:83646


  M +6 -2      dom_nodeimpl.cpp   1.236.2.5


--- kdelibs/khtml/xml/dom_nodeimpl.cpp  #1.236.2.4:1.236.2.5
 @ -1069,4 +1069,8  @ NodeImpl *NodeBaseImpl::replaceChild ( N
         // If child is already present in the tree, first remove it
         NodeImpl *newParent = child->parentNode();
+        if ( child == next )
+            next = child->nextSibling();
+        if ( child == prev )
+            prev = child->previousSibling();
         if(newParent)
             newParent->removeChild( child, exceptioncode );
 @ -1158,5 +1162,5  @ void NodeBaseImpl::removeChildren()
 {
     NodeImpl *n, *next;
-    for( n = _first; n; n = next )
+    for( n = _first, _first = 0; n; n = next )
     {
         next = n->nextSibling();
 @ -1172,5 +1176,5  @ void NodeBaseImpl::removeChildren()
                 c->removedFromDocument();
     }
-    _first = _last = 0;
+    _last = 0;
 }
_______________________________________________
Konq-bugs mailing list
Konq-bugs@mail.kde.org
https://mail.kde.org/mailman/listinfo/konq-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic