Changeset 202762 in webkit


Ignore:
Timestamp:
Jul 1, 2016 4:25:04 PM (8 years ago)
Author:
Chris Dumez
Message:

Possible null Range dereference under AXObjectCache::visiblePositionFromCharacterOffset()
https://bugs.webkit.org/show_bug.cgi?id=159330
<rdar://problem/27123752>

Reviewed by Benjamin Poulain.

rangeForUnorderedCharacterOffsets() can return a null Range but we failed
to do a null check before dereferencing it.

  • accessibility/AXObjectCache.cpp:

(WebCore::AXObjectCache::visiblePositionFromCharacterOffset):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r202761 r202762  
     12016-07-01  Chris Dumez  <cdumez@apple.com>
     2
     3        Possible null Range dereference under AXObjectCache::visiblePositionFromCharacterOffset()
     4        https://bugs.webkit.org/show_bug.cgi?id=159330
     5        <rdar://problem/27123752>
     6
     7        Reviewed by Benjamin Poulain.
     8
     9        rangeForUnorderedCharacterOffsets() can return a null Range but we failed
     10        to do a null check before dereferencing it.
     11
     12        * accessibility/AXObjectCache.cpp:
     13        (WebCore::AXObjectCache::visiblePositionFromCharacterOffset):
     14
    1152016-07-01  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/Source/WebCore/accessibility/AXObjectCache.cpp

    r202516 r202762  
    19591959    // Create a collapsed range and use that to form a VisiblePosition, so that the case with
    19601960    // composed characters will be covered.
    1961     RefPtr<Range> range = rangeForUnorderedCharacterOffsets(characterOffset, characterOffset);
    1962     return VisiblePosition(range->startPosition());
     1961    auto range = rangeForUnorderedCharacterOffsets(characterOffset, characterOffset);
     1962    return range ? VisiblePosition(range->startPosition()) : VisiblePosition();
    19631963}
    19641964
Note: See TracChangeset for help on using the changeset viewer.