⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 201571 in webkit


Ignore:
Timestamp:
Jun 1, 2016, 2:43:09 PM (10 years ago)
Author:
Chris Dumez
Message:

Crash under eventTargetRespectingTargetRules()
https://bugs.webkit.org/show_bug.cgi?id=158273
<rdar://problem/26343998>

Reviewed by Alex Christensen.

The code would call nodeOrHostIfPseudoElement(), which can return null
and then dereference it in eventTargetRespectingTargetRules() without
null check. This patch adds a null check. When the node is null, the
while loop after will do nothing and thus the target will not be used.

No new tests, we do not have a good reproduction case.

  • dom/EventPath.cpp:

(WebCore::EventPath::EventPath):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r201570 r201571  
     12016-06-01  Chris Dumez  <cdumez@apple.com>
     2
     3        Crash under eventTargetRespectingTargetRules()
     4        https://bugs.webkit.org/show_bug.cgi?id=158273
     5        <rdar://problem/26343998>
     6
     7        Reviewed by Alex Christensen.
     8
     9        The code would call nodeOrHostIfPseudoElement(), which can return null
     10        and then dereference it in eventTargetRespectingTargetRules() without
     11        null check. This patch adds a null check. When the node is null, the
     12        while loop after will do nothing and thus the target will not be used.
     13
     14        No new tests, we do not have a good reproduction case.
     15
     16        * dom/EventPath.cpp:
     17        (WebCore::EventPath::EventPath):
     18
    1192016-06-01  Commit Queue  <commit-queue@webkit.org>
    220
  • trunk/Source/WebCore/dom/EventPath.cpp

    r200464 r201571  
    9292#endif
    9393    Node* node = nodeOrHostIfPseudoElement(&originalTarget);
    94     Node* target = eventTargetRespectingTargetRules(*node);
     94    Node* target = node ? eventTargetRespectingTargetRules(*node) : nullptr;
    9595    while (node) {
    9696        while (node) {
Note: See TracChangeset for help on using the changeset viewer.