Changeset 124723 in webkit


Ignore:
Timestamp:
Aug 5, 2012 6:22:40 PM (12 years ago)
Author:
macpherson@chromium.org
Message:

Fix null pointer dereference when CSSParser::sinkFloatingValueList() returns null and is passed to storeVariableDeclaration().
https://bugs.webkit.org/show_bug.cgi?id=92461

Reviewed by Eric Seidel.

Source/WebCore:

Invalid variable lists could cause CSSGrammar.y to pass null as value to storeVariableDeclaration, so we now check for null.

Test: fast/css/variables/invalid-value-list-crash.html

  • css/CSSParser.cpp:

(WebCore::CSSParser::storeVariableDeclaration):

LayoutTests:

Test case that causes CSSParser::storeVariableDeclaration to be passed a null value.

  • fast/css/variables/invalid-value-list-crash-expected.txt: Added.
  • fast/css/variables/invalid-value-list-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r124722 r124723  
     12012-08-05  Luke Macpherson   <macpherson@chromium.org>
     2
     3        Fix null pointer dereference when CSSParser::sinkFloatingValueList() returns null and is passed to storeVariableDeclaration().
     4        https://bugs.webkit.org/show_bug.cgi?id=92461
     5
     6        Reviewed by Eric Seidel.
     7
     8        Test case that causes CSSParser::storeVariableDeclaration to be passed a null value.
     9
     10        * fast/css/variables/invalid-value-list-crash-expected.txt: Added.
     11        * fast/css/variables/invalid-value-list-crash.html: Added.
     12
    1132012-08-05  Kent Tamura  <tkent@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r124721 r124723  
     12012-08-05  Luke Macpherson   <macpherson@chromium.org>
     2
     3        Fix null pointer dereference when CSSParser::sinkFloatingValueList() returns null and is passed to storeVariableDeclaration().
     4        https://bugs.webkit.org/show_bug.cgi?id=92461
     5
     6        Reviewed by Eric Seidel.
     7
     8        Invalid variable lists could cause CSSGrammar.y to pass null as value to storeVariableDeclaration, so we now check for null.
     9
     10        Test: fast/css/variables/invalid-value-list-crash.html
     11
     12        * css/CSSParser.cpp:
     13        (WebCore::CSSParser::storeVariableDeclaration):
     14
    1152012-08-03  Kent Tamura  <tkent@chromium.org>
    216
  • trunk/Source/WebCore/css/CSSParser.cpp

    r124389 r124723  
    30263026void CSSParser::storeVariableDeclaration(const CSSParserString& name, PassOwnPtr<CSSParserValueList> value, bool important)
    30273027{
     3028    // When CSSGrammar.y encounters an invalid declaration it passes null for the CSSParserValueList, just bail.
     3029    if (!value)
     3030        return;
     3031   
    30283032    ASSERT(name.length > 12);
    30293033    AtomicString variableName = String(name.characters + 12, name.length - 12);
Note: See TracChangeset for help on using the changeset viewer.