Changeset 199807 in webkit


Ignore:
Timestamp:
Apr 20, 2016 10:02:23 PM (8 years ago)
Author:
Chris Dumez
Message:

Crash under WebCore::TextIterator::subrange()
https://bugs.webkit.org/show_bug.cgi?id=156809
<rdar://problem/21102730>

Reviewed by Ryosuke Niwa.

TextIterator::rangeFromLocationAndLength() may return null. However, we
failed to do a null check before calling TextIterator::subrange() with
that range.

No new tests, do not know how to reproduce.

  • editing/AlternativeTextController.cpp:

(WebCore::AlternativeTextController::applyAlternativeTextToRange):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r199804 r199807  
     12016-04-20  Chris Dumez  <cdumez@apple.com>
     2
     3        Crash under WebCore::TextIterator::subrange()
     4        https://bugs.webkit.org/show_bug.cgi?id=156809
     5        <rdar://problem/21102730>
     6
     7        Reviewed by Ryosuke Niwa.
     8
     9        TextIterator::rangeFromLocationAndLength() may return null. However, we
     10        failed to do a null check before calling TextIterator::subrange() with
     11        that range.
     12
     13        No new tests, do not know how to reproduce.
     14
     15        * editing/AlternativeTextController.cpp:
     16        (WebCore::AlternativeTextController::applyAlternativeTextToRange):
     17
    1182016-04-20  Brady Eidson  <beidson@apple.com>
    219
  • trunk/Source/WebCore/editing/AlternativeTextController.cpp

    r198306 r199807  
    274274    // Recalculate pragraphRangeContainingCorrection, since SpellingCorrectionCommand modified the DOM, such that the original paragraphRangeContainingCorrection is no longer valid. Radar: 10305315 Bugzilla: 89526
    275275    paragraphRangeContainingCorrection = TextIterator::rangeFromLocationAndLength(&rootNode, paragraphStartIndex, correctionStartOffsetInParagraph + alternative.length());
     276    if (!paragraphRangeContainingCorrection)
     277        return;
    276278   
    277279    setEnd(paragraphRangeContainingCorrection.get(), m_frame.selection().selection().start());
Note: See TracChangeset for help on using the changeset viewer.