<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>112329</bug_id>
          
          <creation_ts>2005-09-09 21:43:42 +0000</creation_ts>
          <short_desc>Konqueror can be crashed with JavaScript and CSS</short_desc>
          <delta_ts>2005-09-09 22:42:11 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>konqueror</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>openSUSE</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>84173</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Christian Kern">c.kern</reporter>
          <assigned_to name="Konqueror Bugs">konqueror-bugs-null</assigned_to>
          <cc>maksim</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>371946</commentid>
    <comment_count>0</comment_count>
    <who name="Christian Kern">c.kern</who>
    <bug_when>2005-09-09 21:43:42 +0000</bug_when>
    <thetext>Version:           3.3.2 (as well as 3.2.3) (using KDE KDE 3.3.2)
Installed from:    SuSE RPMs
Compiler:          gcc, I guess ... 
OS:                Linux

I have two images in a web page and have a JavaScript function to hide and show them
via CSS: document.getElementById(...).styles.display=&apos;none&apos;
Hiding the first one is fine. Then hiding the second one and then asking for the
width of the second image will crash Konqueror.

I&apos;ve tried this on i686 Linux machines. One of them was SuSE 9.0/KDE 3.3.2
(crash handler report below is from this machine), the other was RedHat 8.0/KDE 3.2.3.
I don&apos;t have a newer version of KDE.

Here&apos;s the HTML code:

&lt;?xml version=&apos;1.0&apos; encoding=&apos;ISO-8859-1&apos;?&gt;
&lt;!DOCTYPE html PUBLIC &apos;-//W3C//DTD XHTML 1.0 Transitional//EN&apos; &apos;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&apos;&gt;
&lt;html xmlns=&apos;http://www.w3.org/1999/xhtml&apos;&gt;
&lt;head&gt;&lt;title&gt;Crashing Konqueror with JavaScript and CSS&lt;/title&gt;&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Crashing Konqueror with JavaScript and CSS&lt;/h1&gt;
&lt;p&gt;How to do it: First click &quot;no One&quot;, then &quot;no Two&quot;!&lt;/p&gt;
&lt;hr /&gt;

&lt;!-- ========== Configuration ============================================= --&gt;
&lt;p&gt;
  &lt;b&gt;Configuration:&lt;/b&gt; Show
  (&lt;a href=&apos;javascript:hide(&quot;one&quot;)&apos; id=&apos;hide_one&apos;&gt;no One&lt;/a&gt; |
   &lt;a href=&apos;javascript:show(&quot;one&quot;)&apos; id=&apos;show_one&apos;&gt;   One&lt;/a&gt;) &amp;middot;
  (&lt;a href=&apos;javascript:hide(&quot;two&quot;)&apos; id=&apos;hide_two&apos;&gt;no Two&lt;/a&gt; |
   &lt;a href=&apos;javascript:show(&quot;two&quot;)&apos; id=&apos;show_two&apos;&gt;   Two&lt;/a&gt;)
&lt;/p&gt;
&lt;hr /&gt;

&lt;!-- ========== Two pictures ============================================== --&gt;

  &lt;img id=&apos;id_one&apos; src=&apos;1.png&apos; name=&apos;img_one&apos; alt=&apos;?&apos; width=&apos;32&apos; height=&apos;32&apos; /&gt;
  &lt;img id=&apos;id_two&apos; src=&apos;2.png&apos; name=&apos;img_two&apos; alt=&apos;?&apos; width=&apos;32&apos; height=&apos;32&apos; /&gt;

&lt;!-- ========== Script ==================================================== --&gt;

&lt;script type=&apos;text/javascript&apos;&gt;
   //--- Set basic parameters ---------------------------------------------
   // These hold the information which picture show be shown
   can_be_seen=new Array();
   can_be_seen[&apos;one&apos;]=1;
   can_be_seen[&apos;two&apos;]=1;

   // --- Functions for showing and hiding pictures -----------------------
   function show(id)
     {
      // show picture
      document.getElementById(&apos;id_&apos;+id).style.display=&apos;block&apos;;
      // update configuration
      can_be_seen[id]=1;
      // special: get information about second picture and reload it
      picturewidth=document.getElementsByName(&apos;img_two&apos;)[0][&apos;width&apos;];
     };
   function hide(id)
     {
      // hide picture
      document.getElementById(&apos;id_&apos;+id).style.display=&apos;none&apos;;
      // update configuration
      can_be_seen[id]=0;
      // if no picture is left, show all three
      if (can_be_seen[&apos;one&apos;]+can_be_seen[&apos;two&apos;]==0)
        {
         show(&apos;one&apos;);
         show(&apos;two&apos;);
        };
     };

   // --- At the beginning, initialize pictures once ----------------------
   show(&apos;one&apos;);
   show(&apos;two&apos;);
   // if you&apos;d write &quot;hide&quot; here, Konqueror would crash immediately!

   // --- End of scripting ------------------------------------------------
&lt;/script&gt;

&lt;!-- ========== Page footer =============================================== --&gt;
&lt;hr /&gt;
&lt;/body&gt;
&lt;/html&gt;

Pictures were normal small 32x32 PNG pictures created with kiconedit,
any other pictures are fine too.

Here&apos;s what Konqueror says on the console:

konqueror: ERROR: Error in BrowserExtension::actionSlotMap(), unknown action : searchProvider
konqueror: ERROR: Error in BrowserExtension::actionSlotMap(), unknown action : searchProvider
KCrash: Application &apos;konqueror&apos; crashing...

And here&apos;s what the KDE crash handler delivers:
(it was a SIGSEGV, signal 11)

Using host libthread_db library &quot;/lib/libthread_db.so.1&quot;.
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 3898)]
[KCrash handler]
#4  0x419897e1 in DOM::HTMLImageElementImpl::width ()
   from /usr/local/kde/3.3.2/lib/libkhtml.so.4
#5  0x41adad7f in DOM::HTMLImageElement::width ()
   from /usr/local/kde/3.3.2/lib/libkhtml.so.4
#6  0x41a4bee3 in KJS::HTMLElement::getValueProperty ()
   from /usr/local/kde/3.3.2/lib/libkhtml.so.4
#7  0x41a44921 in KJS::HTMLElement::tryGet ()
   from /usr/local/kde/3.3.2/lib/libkhtml.so.4
#8  0x41a2d510 in KJS::DOMObject::get ()
   from /usr/local/kde/3.3.2/lib/libkhtml.so.4
#9  0x41bc0c30 in KJS::Reference::getValue ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#10 0x41b85d62 in KJS::Node::evaluate ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#11 0x41b8b26e in KJS::AssignNode::evaluate ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#12 0x41b8ce7a in KJS::ExprStatementNode::execute ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#13 0x41b9380c in KJS::SourceElementsNode::execute ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#14 0x41b8cc8f in KJS::BlockNode::execute ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#15 0x41b92ce3 in KJS::FunctionBodyNode::execute ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#16 0x41bb54bc in KJS::DeclaredFunctionImp::execute ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#17 0x41bb4892 in KJS::FunctionImp::call ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#18 0x41bb9d80 in KJS::Object::call ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#19 0x41b88813 in KJS::FunctionCallNode::evaluate ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#20 0x41b8ce7a in KJS::ExprStatementNode::execute ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#21 0x41b93796 in KJS::SourceElementsNode::execute ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#22 0x41b8cc8f in KJS::BlockNode::execute ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#23 0x41b8d21e in KJS::IfNode::execute ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#24 0x41b9380c in KJS::SourceElementsNode::execute ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#25 0x41b8cc8f in KJS::BlockNode::execute ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#26 0x41b92ce3 in KJS::FunctionBodyNode::execute ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#27 0x41bb54bc in KJS::DeclaredFunctionImp::execute ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#28 0x41bb4892 in KJS::FunctionImp::call ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#29 0x41bb9d80 in KJS::Object::call ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#30 0x41b88813 in KJS::FunctionCallNode::evaluate ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#31 0x41b8ce7a in KJS::ExprStatementNode::execute ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#32 0x41b93796 in KJS::SourceElementsNode::execute ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#33 0x41b8cc8f in KJS::BlockNode::execute ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#34 0x41b92ce3 in KJS::FunctionBodyNode::execute ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#35 0x41baa183 in KJS::InterpreterImp::evaluate ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#36 0x41bbbcda in KJS::Interpreter::evaluate ()
   from /usr/local/kde/3.3.2/lib/libkjs.so.1
#37 0x41a7b743 in KJS::KJSProxyImpl::evaluate ()
   from /usr/local/kde/3.3.2/lib/libkhtml.so.4
#38 0x41909bd8 in KHTMLPart::executeScript ()
   from /usr/local/kde/3.3.2/lib/libkhtml.so.4
#39 0x41908dc4 in KHTMLPart::crossFrameExecuteScript ()
   from /usr/local/kde/3.3.2/lib/libkhtml.so.4
#40 0x419157d3 in KHTMLPart::urlSelected ()
   from /usr/local/kde/3.3.2/lib/libkhtml.so.4
#41 0x419822fb in DOM::HTMLAnchorElementImpl::defaultEventHandler ()
   from /usr/local/kde/3.3.2/lib/libkhtml.so.4
#42 0x4195912f in DOM::NodeImpl::dispatchGenericEvent ()
   from /usr/local/kde/3.3.2/lib/libkhtml.so.4
#43 0x41958eb2 in DOM::NodeImpl::dispatchEvent ()
   from /usr/local/kde/3.3.2/lib/libkhtml.so.4
#44 0x418f6910 in KHTMLView::dispatchMouseEvent ()
   from /usr/local/kde/3.3.2/lib/libkhtml.so.4
#45 0x418f0ba6 in KHTMLView::viewportMouseReleaseEvent ()
   from /usr/local/kde/3.3.2/lib/libkhtml.so.4
#46 0x40eaae59 in QScrollView::eventFilter ()
   from /usr/local/kde/3.3.2/lib/libqt-mt.so.3
#47 0x418f2689 in KHTMLView::eventFilter ()
   from /usr/local/kde/3.3.2/lib/libkhtml.so.4
#48 0x40d9731e in QObject::activate_filters ()
   from /usr/local/kde/3.3.2/lib/libqt-mt.so.3
#49 0x40d9724c in QObject::event () from /usr/local/kde/3.3.2/lib/libqt-mt.so.3
#50 0x40dcf1ef in QWidget::event () from /usr/local/kde/3.3.2/lib/libqt-mt.so.3
#51 0x40d3dbef in QApplication::internalNotify ()
   from /usr/local/kde/3.3.2/lib/libqt-mt.so.3
#52 0x40d3d2f1 in QApplication::notify ()
   from /usr/local/kde/3.3.2/lib/libqt-mt.so.3
#53 0x4084adb7 in KApplication::notify ()
   from /usr/local/kde/3.3.2/lib/libkdecore.so.4
#54 0x40cd49c8 in QETWidget::translateMouseEvent ()
   from /usr/local/kde/3.3.2/lib/libqt-mt.so.3
#55 0x40cd267b in QApplication::x11ProcessEvent ()
   from /usr/local/kde/3.3.2/lib/libqt-mt.so.3
#56 0x40ce8fd1 in QEventLoop::processEvents ()
   from /usr/local/kde/3.3.2/lib/libqt-mt.so.3
#57 0x40d4fdc8 in QEventLoop::enterLoop ()
   from /usr/local/kde/3.3.2/lib/libqt-mt.so.3
#58 0x40d4fc78 in QEventLoop::exec ()
   from /usr/local/kde/3.3.2/lib/libqt-mt.so.3
#59 0x40d3de41 in QApplication::exec ()
   from /usr/local/kde/3.3.2/lib/libqt-mt.so.3
#60 0x4005ef6c in kdemain ()
   from /usr/local/kde/3.3.2/lib/libkdeinit_konqueror.so
#61 0x080486eb in ?? ()
#62 0x00000002 in ?? ()
#63 0xbffff6d4 in ?? ()
#64 0xbffff6a8 in ?? ()
#65 0x414d4d17 in __libc_start_main () from /lib/i686/libc.so.6</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>371955</commentid>
    <comment_count>1</comment_count>
    <who name="Maksim Orlovich">maksim</who>
    <bug_when>2005-09-09 22:42:11 +0000</bug_when>
    <thetext>Works fine for me, 3.5 development branch, looks like #84173

*** This bug has been marked as a duplicate of 84173 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>