⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 98374 in webkit


Ignore:
Timestamp:
Oct 25, 2011, 12:28:15 PM (15 years ago)
Author:
cevans@google.com
Message:

Manage the CSS property array length correctly
https://bugs.webkit.org/show_bug.cgi?id=70783

Reviewed by Adam Barth.

  • css/CSSParser.cpp:

(WebCore::CSSParser::addProperty): don't allow max length to get out of sync with the buffer.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r98373 r98374  
     12011-10-25  Chris Evans  <cevans@google.com>
     2
     3        Manage the CSS property array length correctly
     4        https://bugs.webkit.org/show_bug.cgi?id=70783
     5
     6        Reviewed by Adam Barth.
     7
     8        * css/CSSParser.cpp:
     9        (WebCore::CSSParser::addProperty): don't allow max length to get out of sync with the buffer.
     10
    1112011-10-25  Tony Chang  <tony@chromium.org>
    212
  • trunk/Source/WebCore/css/CSSParser.cpp

    r97991 r98374  
    614614    OwnPtr<CSSProperty> prop(adoptPtr(new CSSProperty(propId, value, important, m_currentShorthand, m_implicitShorthand)));
    615615    if (m_numParsedProperties >= m_maxParsedProperties) {
     616        if (m_numParsedProperties > (UINT_MAX / sizeof(CSSProperty*)) - 32)
     617            CRASH();  // Avoid inconsistencies with rollbackLastProperties.
    616618        m_maxParsedProperties += 32;
    617         if (m_maxParsedProperties > UINT_MAX / sizeof(CSSProperty*))
    618             return;
    619619        m_parsedProperties = static_cast<CSSProperty**>(fastRealloc(m_parsedProperties,
    620620            m_maxParsedProperties * sizeof(CSSProperty*)));
Note: See TracChangeset for help on using the changeset viewer.