Changeset 259670 in webkit


Ignore:
Timestamp:
Apr 7, 2020 2:09:43 PM (4 years ago)
Author:
Lauro Moura
Message:

[GLIB] Avoid potential segfault in getPlatformEditorState
https://bugs.webkit.org/show_bug.cgi?id=210149

Reviewed by Carlos Alberto Lopez Perez.

Avoid potential surroundingRange dereference segfault.

  • WebProcess/WebPage/glib/WebPageGLib.cpp:

(WebKit::WebPage::getPlatformEditorState const):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r259669 r259670  
     12020-04-07  Lauro Moura  <lmoura@igalia.com>
     2
     3        [GLIB] Avoid potential segfault in getPlatformEditorState
     4        https://bugs.webkit.org/show_bug.cgi?id=210149
     5
     6        Reviewed by Carlos Alberto Lopez Perez.
     7
     8        Avoid potential surroundingRange dereference segfault.
     9
     10        * WebProcess/WebPage/glib/WebPageGLib.cpp:
     11        (WebKit::WebPage::getPlatformEditorState const):
     12
    1132020-04-07  Wenson Hsieh  <wenson_hsieh@apple.com>
    214
  • trunk/Source/WebKit/WebProcess/WebPage/glib/WebPageGLib.cpp

    r259468 r259670  
    110110        auto surroundingRange = makeRange(surroundingStart, surroundingEnd);
    111111        auto compositionRange = frame.editor().compositionRange();
    112         if (compositionRange && surroundingRange->contains(*compositionRange)) {
     112        if (compositionRange && surroundingRange && surroundingRange->contains(*compositionRange)) {
    113113            auto clonedRange = surroundingRange->cloneRange();
    114114            surroundingRange->setEnd(compositionRange->startPosition());
Note: See TracChangeset for help on using the changeset viewer.