Changeset 65587 in webkit


Ignore:
Timestamp:
Aug 18, 2010 12:37:56 AM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-08-18 Adam Barth <abarth@webkit.org>

Reviewed by Adele Peterson.

Null dereference in DOMSelection::deleteFromDocument
https://bugs.webkit.org/show_bug.cgi?id=44153

deleteFromDocument checks selection->isNone() before calling
selection->selection().toNormalizedRange(), but toNormalizedRange()
notes that it needs to updateLayout(), which can make the selection
isNone() again. In that case, we crash on a NULL pointer in
deleteFromDocument. I don't know how to trigger that situation in a
test, but cross_fuzz was able to hit it, so we should fix it.

  • page/DOMSelection.cpp: (WebCore::DOMSelection::deleteFromDocument):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r65586 r65587  
     12010-08-18  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Adele Peterson.
     4
     5        Null dereference in DOMSelection::deleteFromDocument
     6        https://bugs.webkit.org/show_bug.cgi?id=44153
     7
     8        deleteFromDocument checks selection->isNone() before calling
     9        selection->selection().toNormalizedRange(), but toNormalizedRange()
     10        notes that it needs to updateLayout(), which can make the selection
     11        isNone() again.  In that case, we crash on a NULL pointer in
     12        deleteFromDocument.  I don't know how to trigger that situation in a
     13        test, but cross_fuzz was able to hit it, so we should fix it.
     14
     15        * page/DOMSelection.cpp:
     16        (WebCore::DOMSelection::deleteFromDocument):
     17
    1182010-08-17  Girish Ramakrishnan  <girish@forwardbias.in>
    219
  • trunk/WebCore/page/DOMSelection.cpp

    r60463 r65587  
    428428
    429429    RefPtr<Range> selectedRange = selection->selection().toNormalizedRange();
     430    if (!selectedRange)
     431        return;
    430432
    431433    ExceptionCode ec = 0;
Note: See TracChangeset for help on using the changeset viewer.