Changeset 126681 in webkit


Ignore:
Timestamp:
Aug 25, 2012, 2:23:44 AM (13 years ago)
Author:
Michelangelo De Simone
Message:

[Crash] Null pointer in CSSParser::parseMixFunction()
https://bugs.webkit.org/show_bug.cgi?id=94998

Reviewed by Benjamin Poulain.

Source/WebCore:

parseMixFunction() may try to access invalid memory when the arguments of the
mix() function are comma-terminated.

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseMixFunction):

LayoutTests:

New test cases added to check invalid comma-terminated values within mix().

  • css3/filters/custom/custom-filter-property-parsing-invalid-expected.txt:
  • css3/filters/script-tests/custom-filter-property-parsing-invalid.js:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r126680 r126681  
     12012-08-25  Michelangelo De Simone  <michelangelo@webkit.org>
     2
     3        [Crash] Null pointer in CSSParser::parseMixFunction()
     4        https://bugs.webkit.org/show_bug.cgi?id=94998
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        New test cases added to check invalid comma-terminated values within mix().
     9
     10        * css3/filters/custom/custom-filter-property-parsing-invalid-expected.txt:
     11        * css3/filters/script-tests/custom-filter-property-parsing-invalid.js:
     12
    1132012-08-24  Zan Dobersek  <zandobersek@gmail.com>
    214
  • trunk/LayoutTests/css3/filters/custom/custom-filter-property-parsing-invalid-expected.txt

    r125845 r126681  
    100100PASS declaration.getPropertyValue('-webkit-filter') is null
    101101
     102Mix function with comma terminator : custom(none mix(url(shader), multiply clear,))
     103PASS cssRule.type is 1
     104PASS declaration.length is 0
     105PASS declaration.getPropertyValue('-webkit-filter') is null
     106
     107Mix function with one comma : custom(none mix(,))
     108PASS cssRule.type is 1
     109PASS declaration.length is 0
     110PASS declaration.getPropertyValue('-webkit-filter') is null
     111
    102112No shader : custom(none, 10 20)
    103113PASS cssRule.type is 1
  • trunk/LayoutTests/css3/filters/script-tests/custom-filter-property-parsing-invalid.js

    r125845 r126681  
    4848testInvalidFilterRule("Mix function with 4 args", "custom(none mix(url(shader) multiply clear normal))");
    4949testInvalidFilterRule("Mix function with comma separators", "custom(none mix(url(shader), multiply, clear))");
     50testInvalidFilterRule("Mix function with comma terminator", "custom(none mix(url(shader), multiply clear,))");
     51testInvalidFilterRule("Mix function with one comma", "custom(none mix(,))");
    5052
    5153testInvalidFilterRule("No shader", "custom(none, 10 20)");
  • trunk/Source/WebCore/ChangeLog

    r126675 r126681  
     12012-08-25  Michelangelo De Simone  <michelangelo@webkit.org>
     2
     3        [Crash] Null pointer in CSSParser::parseMixFunction()
     4        https://bugs.webkit.org/show_bug.cgi?id=94998
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        parseMixFunction() may try to access invalid memory when the arguments of the
     9        mix() function are comma-terminated.
     10
     11        * css/CSSParser.cpp:
     12        (WebCore::CSSParser::parseMixFunction):
     13
    1142012-08-24  Helder Correia  <helder.correia@nokia.com>
    215
  • trunk/Source/WebCore/css/CSSParser.cpp

    r126524 r126681  
    74467446
    74477447    CSSParserValueList* argsList = value->function->args.get();
     7448    if (!argsList)
     7449        return 0;
     7450
    74487451    unsigned numArgs = argsList->size();
    74497452    if (numArgs < 1 || numArgs > 3)
Note: See TracChangeset for help on using the changeset viewer.