Summary: | [test case] <FRAMESET onLoad="foo"> crashes konqueror | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Grzegorz Jaskiewicz <gj> |
Component: | khtml event | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | christophe_goudey, lecit, maksim, shr3kst3r |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Grzegorz Jaskiewicz
2005-06-04 21:17:08 UTC
Both created with meangle2.cgi (random html output) http://gj.pointblue.com.pl/1117917369744413000.html http://gj.pointblue.com.pl/1117917387153980000.html valgrind output: gj.pointblue.com.pl/kafilah.pid17054 Reduced version: <BODY> <FRAMESET onLoad="foo"> Probably related: http://lists.kde.org/?l=kfm-devel&m=111659456130916&w=2 *** Bug 111055 has been marked as a duplicate of this bug. *** *** Bug 121759 has been marked as a duplicate of this bug. *** *** Bug 130323 has been marked as a duplicate of this bug. *** SVN commit 559960 by orlovich: Remove the listeners when we die, in case the parser kills us, or some unforseen JS evil does (This is the only case where it matters --- all others are added to self or have null/default scope). BUG:106795 M +15 -4 html_baseimpl.cpp M +3 -0 html_baseimpl.h --- branches/KDE/3.5/kdelibs/khtml/html/html_baseimpl.cpp #559959:559960 @@ -445,10 +445,21 @@ noresize = false; m_resizing = false; + + m_onLoad = m_onUnLoad = 0; } HTMLFrameSetElementImpl::~HTMLFrameSetElementImpl() { + //### this is likely not quite right since we may be effectively "overriding" some old value, + //which needs to be recomputed, but this is better than crashing... + if (m_onLoad && getDocument()->getHTMLEventListener(EventImpl::LOAD_EVENT) == m_onLoad) + getDocument()->setHTMLEventListener(EventImpl::LOAD_EVENT, 0); + + if (m_onUnLoad && getDocument()->getHTMLEventListener(EventImpl::UNLOAD_EVENT) == m_onUnLoad) + getDocument()->setHTMLEventListener(EventImpl::UNLOAD_EVENT, 0); + + delete [] m_rows; delete [] m_cols; } @@ -491,12 +502,12 @@ frameborder = false; break; case ATTR_ONLOAD: - getDocument()->setHTMLEventListener(EventImpl::LOAD_EVENT, - getDocument()->createHTMLEventListener(attr->value().string(), "onload", this)); + m_onLoad = getDocument()->createHTMLEventListener(attr->value().string(), "onload", this); + getDocument()->setHTMLEventListener(EventImpl::LOAD_EVENT, m_onLoad); break; case ATTR_ONUNLOAD: - getDocument()->setHTMLEventListener(EventImpl::UNLOAD_EVENT, - getDocument()->createHTMLEventListener(attr->value().string(), "onunload", this)); + m_onUnLoad = getDocument()->createHTMLEventListener(attr->value().string(), "onunload", this); + getDocument()->setHTMLEventListener(EventImpl::UNLOAD_EVENT, m_onUnLoad); break; default: HTMLElementImpl::parseAttribute(attr); --- branches/KDE/3.5/kdelibs/khtml/html/html_baseimpl.h #559959:559960 @@ -149,6 +149,9 @@ bool frameBorderSet : 1; bool noresize : 1; bool m_resizing : 1; // is the user resizing currently + + EventListener* m_onLoad; + EventListener* m_onUnLoad; }; // ------------------------------------------------------------------------- SVN commit 559965 by orlovich: Testcase + baseline CCBUG:106795 A baseline/unsorted/106795.html-dom A baseline/unsorted/106795.html-render M +1 -0 baseline/unsorted/svnignore A tests/unsorted/106795.html --- trunk/tests/khtmltests/regression/baseline/unsorted/svnignore #559964:559965 @@ -42,3 +42,4 @@ 110036.html-dump.png 116325.html-dump.png 116599.html-dump.png +106795.html-dump.png |