Changeset 258625 in webkit


Ignore:
Timestamp:
Mar 17, 2020 10:47:14 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

Crash in CSSPrimitiveValue::cleanup
https://bugs.webkit.org/show_bug.cgi?id=208316

Patch by Pinki Gyanchandani <pgyanchandani@apple.com> on 2020-03-17
Reviewed by Ryosuke Niwa.

Source/WebCore:

Added a NULL check before calling deref() for CSSUnitType :: CSS_CALC.

During initialization of CSSCalcValue, createCSS returns nullptr when processing min() operator
and there is a category mismatch between length and percent for min() operator
as seen in this newly added test case.

Test: editing/execCommand/primitive-value-cleanup-minimal.html

  • css/CSSPrimitiveValue.cpp:

(WebCore::CSSPrimitiveValue::cleanup):

LayoutTests:

Added modified version of testcase attached in 208316. Minimized version provided by Ryosuke Niwa.

  • editing/execCommand/primitive-value-cleanup-minimal-expected.txt: Added.
  • editing/execCommand/primitive-value-cleanup-minimal.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r258619 r258625  
     12020-03-17  Pinki Gyanchandani  <pgyanchandani@apple.com>
     2
     3        Crash in CSSPrimitiveValue::cleanup
     4        https://bugs.webkit.org/show_bug.cgi?id=208316
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Added modified version of testcase attached in 208316. Minimized version provided by Ryosuke Niwa.
     9
     10        * editing/execCommand/primitive-value-cleanup-minimal-expected.txt: Added.
     11        * editing/execCommand/primitive-value-cleanup-minimal.html: Added.
     12
    1132020-03-17  Lauro Moura  <lmoura@igalia.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r258614 r258625  
     12020-03-17  Pinki Gyanchandani  <pgyanchandani@apple.com>
     2
     3        Crash in CSSPrimitiveValue::cleanup
     4        https://bugs.webkit.org/show_bug.cgi?id=208316
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Added a NULL check before calling deref() for CSSUnitType :: CSS_CALC.
     9
     10        During initialization of CSSCalcValue, createCSS returns nullptr when processing min() operator
     11        and there is a category mismatch between length and percent for min() operator
     12        as seen in this newly added test case.
     13
     14        Test: editing/execCommand/primitive-value-cleanup-minimal.html
     15
     16        * css/CSSPrimitiveValue.cpp:
     17        (WebCore::CSSPrimitiveValue::cleanup):
     18
    1192020-03-17  Fujii Hironori  <Hironori.Fujii@sony.com>
    220
  • trunk/Source/WebCore/css/CSSPrimitiveValue.cpp

    r256494 r258625  
    453453        break;
    454454    case CSSUnitType::CSS_CALC:
    455         m_value.calc->deref();
     455        if (m_value.calc)
     456            m_value.calc->deref();
    456457        break;
    457458    case CSSUnitType::CSS_CALC_PERCENTAGE_WITH_NUMBER:
Note: See TracChangeset for help on using the changeset viewer.