From kde-commits Sat Sep 19 18:01:14 2009 From: Maks Orlovich Date: Sat, 19 Sep 2009 18:01:14 +0000 To: kde-commits Subject: KDE/kdelibs/khtml Message-Id: <1253383274.505946.26117.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=125338446321876 SVN commit 1025798 by orlovich: automatically merged revision 1025797: Fix crash in runAdFilter --- take in account that when we're removing a node its kids will be removed as well... BUG: 192308 M +5 -1 khtml_part.cpp --- trunk/KDE/kdelibs/khtml/khtml_part.cpp #1025797:1025798 @@ -6578,7 +6578,11 @@ { if ( KHTMLGlobal::defaultHTMLSettings()->isAdFiltered( d->m_doc->completeURL( static_cast(node)->getAttribute(ATTR_SRC).string() ) ) ) { - // We found an IMG, IFRAME or INPUT (of type IMAGE) matching a filter. + // Since any kids of node will be deleted, too, fastforward nextNode + // until we get outside of node. + while (nextNode && nextNode->isAncestor(node)) + nextNode = nextNode->traverseNextNode(); + node->ref(); NodeImpl *parent = node->parent(); if( parent )