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

List:       kde-commits
Subject:    branches/KDE/3.5/kdelibs/khtml/html
From:       Germain Garand <germain () ebooksfrance ! com>
Date:       2006-07-02 11:32:44
Message-ID: 1151839964.304295.27874.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 557085 by ggarand:

merge parser crash fix.
WC/#7137/r14048,r14081/



 M  +7 -1      htmlparser.cpp  


--- branches/KDE/3.5/kdelibs/khtml/html/htmlparser.cpp #557084:557085
@@ -680,7 +680,11 @@
             {
                 NodeImpl *node = current;
                 NodeImpl *parent = node->parentNode();
-
+                // A script may have removed the current node's parent from the DOM
+                // http://bugzilla.opendarwin.org/show_bug.cgi?id=7137
+                // FIXME: we should do real recovery here and re-parent with the \
correct node. +                if (!parent)
+                    return false;
                 NodeImpl *parentparent = parent->parentNode();
 
                 if (n->isTextNode() ||
@@ -694,6 +698,8 @@
                     node = (node->id() == ID_TABLE) ? node :
                            ((node->id() == ID_TR ) ? parentparent : parent);
                     NodeImpl *parent = node->parentNode();
+                    if (!parent)
+                        return false;
                     int exceptioncode = 0;
 #ifdef PARSER_DEBUG
                     kdDebug( 6035 ) << "calling insertBefore(" << \
n->nodeName().string() << "," << node->nodeName().string() << ")" << endl;


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

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