Changeset 93477 in webkit


Ignore:
Timestamp:
Aug 20, 2011 12:30:57 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

OOB Read in WebCore::SVGAnimationElement
https://bugs.webkit.org/show_bug.cgi?id=65858

Patch by Ken Buchanan <kenrb@chromium.org> on 2011-08-20
Reviewed by Nikolas Zimmermann.

Source/WebCore:

Potential crash resulting from incorrect keySpline array lengths. This fix validates the length in startedActiveInterval.

Test: svg/animations/animate-calcMode-spline-crash-bad-array-length.xhtml

  • svg/SVGAnimationElement.cpp:

(WebCore::SVGAnimationElement::parseMappedAttribute):
(WebCore::SVGAnimationElement::calculateKeyTimesIndex):

LayoutTests:

Added test case covering keySpline array length problem.

  • svg/animations/animate-calcMode-spline-crash-bad-array-length-expected.txt: Added.
  • svg/animations/animate-calcMode-spline-crash-bad-array-length.xhtml: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    • Property svn:executable set to *
    r93476 r93477  
     12011-08-20  Ken Buchanan  <kenrb@chromium.org>
     2
     3        OOB Read in WebCore::SVGAnimationElement
     4        https://bugs.webkit.org/show_bug.cgi?id=65858
     5
     6        Reviewed by Nikolas Zimmermann.
     7
     8        Added test case covering keySpline array length problem.
     9
     10        * svg/animations/animate-calcMode-spline-crash-bad-array-length-expected.txt: Added.
     11        * svg/animations/animate-calcMode-spline-crash-bad-array-length.xhtml: Added.
     12
    1132011-08-19  Sheriff Bot  <webkit.review.bot@gmail.com>
    214
  • trunk/Source/WebCore/ChangeLog

    • Property svn:executable set to *
    r93476 r93477  
     12011-08-20  Ken Buchanan  <kenrb@chromium.org>
     2
     3        OOB Read in WebCore::SVGAnimationElement
     4        https://bugs.webkit.org/show_bug.cgi?id=65858
     5
     6        Reviewed by Nikolas Zimmermann.
     7
     8        Potential crash resulting from incorrect keySpline array lengths. This fix validates the length in startedActiveInterval.
     9
     10        Test: svg/animations/animate-calcMode-spline-crash-bad-array-length.xhtml
     11
     12        * svg/SVGAnimationElement.cpp:
     13        (WebCore::SVGAnimationElement::parseMappedAttribute):
     14        (WebCore::SVGAnimationElement::calculateKeyTimesIndex):
     15
    1162011-08-19  Sheriff Bot  <webkit.review.bot@gmail.com>
    217
  • trunk/Source/WebCore/svg/SVGAnimationElement.cpp

    r93300 r93477  
    414414    unsigned index;
    415415    unsigned keyTimesCount = m_keyTimes.size();
    416     for (index = 1; index < keyTimesCount; ++index) {
     416    // Compare index + 1 to keyTimesCount because the last keyTimes entry is
     417    // required to be 1, and percent can never exceed 1; i.e., the second last
     418    // keyTimes entry defines the beginning of the final interval
     419    for (index = 1; index + 1 < keyTimesCount; ++index) {
    417420        if (m_keyTimes[index] > percent)
    418421            break;
     
    552555        unsigned splinesCount = m_keySplines.size() + 1;
    553556        if ((fastHasAttribute(SVGNames::keyPointsAttr) && m_keyPoints.size() != splinesCount)
    554             || (animationMode == ValuesAnimation && m_values.size() != splinesCount))
     557            || (animationMode == ValuesAnimation && m_values.size() != splinesCount)
     558            || (fastHasAttribute(SVGNames::keyTimesAttr) && m_keyTimes.size() != splinesCount))
    555559            return;
    556560    }
Note: See TracChangeset for help on using the changeset viewer.