Changeset 138141 in webkit


Ignore:
Timestamp:
Dec 19, 2012 3:56:08 AM (11 years ago)
Author:
reni@webkit.org
Message:

CSSParser crases, when no context is available, and the value is a valid keyword
https://bugs.webkit.org/show_bug.cgi?id=105275

Reviewed by Tony Chang.

ParserContext could be null even if the keyword is valid. We have to check it.

Source/WebCore:

Test: fast/css/invalid-parsercontext-valid-keyword-crash.svg

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue):

LayoutTests:

  • fast/css/invalid-parsercontext-valid-keyword-crash-expected.txt: Added.
  • fast/css/invalid-parsercontext-valid-keyword-crash.svg: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r138139 r138141  
     12012-12-19  Renata Hodovan  <reni@webkit.org>
     2
     3        CSSParser crases, when no context is available, and the value is a valid keyword
     4        https://bugs.webkit.org/show_bug.cgi?id=105275
     5
     6        Reviewed by Tony Chang.
     7
     8        ParserContext could be null even if the keyword is valid. We have to check it.
     9
     10        * fast/css/invalid-parsercontext-valid-keyword-crash-expected.txt: Added.
     11        * fast/css/invalid-parsercontext-valid-keyword-crash.svg: Added.
     12
    1132012-12-19  Dominik Röttsches  <dominik.rottsches@intel.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r138140 r138141  
     12012-12-19  Renata Hodovan  <reni@webkit.org>
     2
     3        CSSParser crases, when no context is available, and the value is a valid keyword
     4        https://bugs.webkit.org/show_bug.cgi?id=105275
     5
     6        Reviewed by Tony Chang.
     7
     8        ParserContext could be null even if the keyword is valid. We have to check it.
     9
     10        Test: fast/css/invalid-parsercontext-valid-keyword-crash.svg
     11
     12        * css/CSSParser.cpp:
     13        (WebCore::CSSParser::parseValue):
     14
    1152012-12-19  Kondapally Kalyan  <kalyan.kondapally@intel.com>
    216
  • trunk/Source/WebCore/css/CSSParser.cpp

    r137955 r138141  
    12301230    if (parseColorValue(declaration, propertyID, string, important, cssParserMode))
    12311231        return true;
    1232     if (parseKeywordValue(declaration, propertyID, string, important, contextStyleSheet->parserContext()))
    1233         return true;
    1234     if (parseTranslateTransformValue(declaration, propertyID, string, important))
    1235         return true;
    12361232
    12371233    CSSParserContext context(cssParserMode);
     
    12401236        context.mode = cssParserMode;
    12411237    }
     1238
     1239    if (parseKeywordValue(declaration, propertyID, string, important, context))
     1240        return true;
     1241    if (parseTranslateTransformValue(declaration, propertyID, string, important))
     1242        return true;
     1243
    12421244    CSSParser parser(context);
    12431245    return parser.parseValue(declaration, propertyID, string, important, contextStyleSheet);
Note: See TracChangeset for help on using the changeset viewer.