Changeset 246653 in webkit


Ignore:
Timestamp:
Jun 20, 2019 2:42:50 PM (5 years ago)
Author:
rniwa@webkit.org
Message:

REGRESSION(r245912): Crash in TextIterator::range via visiblePositionForIndexUsingCharacterIterator
https://bugs.webkit.org/show_bug.cgi?id=199061

Reviewed by Wenson Hsieh.

Avoid calling CharacterIterator::range when it's at the end. Otherwise, we'd crash with null pointer dereferencing.

Unfortunately no new tests since we don't have any reproducible test case.

  • editing/Editing.cpp:

(WebCore::visiblePositionForIndexUsingCharacterIterator):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r246652 r246653  
     12019-06-20  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        REGRESSION(r245912): Crash in TextIterator::range via visiblePositionForIndexUsingCharacterIterator
     4        https://bugs.webkit.org/show_bug.cgi?id=199061
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        Avoid calling CharacterIterator::range when it's at the end. Otherwise, we'd crash with null pointer dereferencing.
     9
     10        Unfortunately no new tests since we don't have any reproducible test case.
     11
     12        * editing/Editing.cpp:
     13        (WebCore::visiblePositionForIndexUsingCharacterIterator):
     14
    1152019-06-20  Brent Fulgham  <bfulgham@apple.com>
    216
  • trunk/Source/WebCore/editing/Editing.cpp

    r246490 r246653  
    11281128        if (range->startPosition() == range->endPosition()) {
    11291129            it.advance(1);
    1130             return VisiblePosition(it.range()->startPosition());
     1130            if (!it.atEnd())
     1131                return VisiblePosition(it.range()->startPosition());
    11311132        }
    11321133    }
Note: See TracChangeset for help on using the changeset viewer.