⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 278398 in webkit


Ignore:
Timestamp:
Jun 3, 2021, 12:09:28 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Crash in HTMLConverter::_addLinkForElement()
​https://bugs.webkit.org/show_bug.cgi?id=226398

Patch by Julian Gonzalez <​julian_a_gonzalez@apple.com> on 2021-06-03
Reviewed by Ryosuke Niwa.

Source/WebCore:

While traversing a node, exit an element with a startIndex
that is always inside the bounds of the attribute string.

Test: editing/pasteboard/select-all-link-cut.html

  • editing/cocoa/HTMLConverter.mm:

(HTMLConverter::_traverseNode):

LayoutTests:

Add a test for this crasher.

  • editing/pasteboard/select-all-link-cut-expected.txt: Added.
  • editing/pasteboard/select-all-link-cut.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r278391 r278398  
     12021-06-03  Julian Gonzalez  <julian_a_gonzalez@apple.com>
     2
     3        Crash in HTMLConverter::_addLinkForElement()
     4        https://bugs.webkit.org/show_bug.cgi?id=226398
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Add a test for this crasher.
     9
     10        * editing/pasteboard/select-all-link-cut-expected.txt: Added.
     11        * editing/pasteboard/select-all-link-cut.html: Added.
     12
    1132021-06-02  Alex Christensen  <achristensen@webkit.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r278397 r278398  
     12021-06-03  Julian Gonzalez  <julian_a_gonzalez@apple.com>
     2
     3        Crash in HTMLConverter::_addLinkForElement()
     4        https://bugs.webkit.org/show_bug.cgi?id=226398
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        While traversing a node, exit an element with a startIndex
     9        that is always inside the bounds of the attribute string.
     10
     11        Test: editing/pasteboard/select-all-link-cut.html
     12
     13        * editing/cocoa/HTMLConverter.mm:
     14        (HTMLConverter::_traverseNode):
     15
    1162021-06-02  Rob Buis  <rbuis@igalia.com>
    217
  • trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm

    r278185 r278398  
    22172217                    }
    22182218                }
    2219                 _exitElement(element, depth, startIndex);
     2219                _exitElement(element, depth, std::min(startIndex, [_attrStr length]));
    22202220            }
    22212221        }
Note: See TracChangeset for help on using the changeset viewer.