Changeset 217227 in webkit


Ignore:
Timestamp:
May 22, 2017 11:16:18 AM (7 years ago)
Author:
Antti Koivisto
Message:

Crash in WebCore::StyleRuleKeyframes::findKeyframeIndex
https://bugs.webkit.org/show_bug.cgi?id=170756
<rdar://problem/31573157>

Reviewed by Andreas Kling.

Source/WebCore:

Using a malformed key with CSSKeyframesRule.findRule crashes because
CSSParser::parseKeyframeKeyList returns null which is then dereferenced.

  • css/CSSKeyframesRule.cpp:

(WebCore::StyleRuleKeyframes::findKeyframeIndex): Null test.

LayoutTests:

Expand the tests to cover the malformed key case.

  • animations/keyframes-rule.html:
  • animations/unprefixed-keyframes-rule.html:
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r217225 r217227  
     12017-05-22  Antti Koivisto  <antti@apple.com>
     2
     3        Crash in WebCore::StyleRuleKeyframes::findKeyframeIndex
     4        https://bugs.webkit.org/show_bug.cgi?id=170756
     5        <rdar://problem/31573157>
     6
     7        Reviewed by Andreas Kling.
     8
     9        Expand the tests to cover the malformed key case.
     10
     11        * animations/keyframes-rule.html:
     12        * animations/unprefixed-keyframes-rule.html:
     13
    1142017-05-22  youenn fablet  <youenn@apple.com>
    215
  • trunk/LayoutTests/animations/keyframes-rule-expected.txt

    r179197 r217227  
    5858PASS Non-existent rule was not found
    5959
     60Try to find a rule using a malformed key
     61PASS rule is null
     62
    6063Delete a rule
    6164PASS rules2.length is 2
  • trunk/LayoutTests/animations/keyframes-rule.html

    r191132 r217227  
    162162
    163163debug("");
     164debug("Try to find a rule using a malformed key");
     165
     166rule = keyframes2.findRule("1");
     167
     168shouldBe("rule", "null");
     169
     170debug("");
    164171debug("Delete a rule");
    165172
  • trunk/LayoutTests/animations/unprefixed-keyframes-rule-expected.txt

    r180441 r217227  
    5858PASS Non-existent rule was not found
    5959
     60Try to find a rule using a malformed key
     61PASS rule is null
     62
    6063Delete a rule
    6164PASS rules2.length is 2
  • trunk/LayoutTests/animations/unprefixed-keyframes-rule.html

    r191132 r217227  
    162162
    163163debug("");
     164debug("Try to find a rule using a malformed key");
     165
     166rule = keyframes2.findRule("1");
     167
     168shouldBe("rule", "null");
     169
     170debug("");
    164171debug("Delete a rule");
    165172
  • trunk/Source/WebCore/ChangeLog

    r217224 r217227  
     12017-05-22  Antti Koivisto  <antti@apple.com>
     2
     3        Crash in WebCore::StyleRuleKeyframes::findKeyframeIndex
     4        https://bugs.webkit.org/show_bug.cgi?id=170756
     5        <rdar://problem/31573157>
     6
     7        Reviewed by Andreas Kling.
     8
     9        Using a malformed key with CSSKeyframesRule.findRule crashes because
     10        CSSParser::parseKeyframeKeyList returns null which is then dereferenced.
     11
     12        * css/CSSKeyframesRule.cpp:
     13        (WebCore::StyleRuleKeyframes::findKeyframeIndex): Null test.
     14
    1152017-05-22  Wenson Hsieh  <wenson_hsieh@apple.com>
    216
  • trunk/Source/WebCore/css/CSSKeyframesRule.cpp

    r210758 r217227  
    106106    auto keys = CSSParser::parseKeyframeKeyList(key);
    107107
     108    if (!keys)
     109        return notFound;
     110
    108111    for (size_t i = m_keyframes.size(); i--; ) {
    109112        if (m_keyframes[i]->keys() == *keys)
Note: See TracChangeset for help on using the changeset viewer.