Changeset 56956 in webkit


Ignore:
Timestamp:
Apr 1, 2010 5:44:03 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-01 Chris Evans <cevans@chromium.org>

Reviewed by Adam Barth.

Add test for XSLT NULL crash:
https://bugs.webkit.org/show_bug.cgi?id=36804

  • LayoutTests/fast/xsl/xslt-bad-import-uri.html: added
  • LayoutTests/fast/xsl/xslt-bad-import-uri-expected.txt: added
  • LayoutTests/fast/xsl/resources/xslt-bad-import-uri.xml: added
  • LayoutTests/fast/xsl/resources/xslt-bad-import-uri.xsl: added

2010-04-01 Chris Evans <cevans@chromium.org>

Reviewed by Adam Barth.

Fix a NULL pointer crash if @import fails to load a stylesheet.

https://bugs.webkit.org/show_bug.cgi?id=36804

Test: fast/xsl/xslt-bad-import-uri.html

  • xml/XSLStyleSheetLibxslt.cpp: (WebCore::XSLStyleSheet::parseString): Handle an empty string gracefully. An empty string has a NULL buffer, which we pass in to xmlCreateMemoryParserCtxt(). It returns NULL if it is passed a NULL buffer. In the top-level XSL case, the current code does not crash "by luck" because the other APIs used can handle a NULL argument. In the @import case, additional code runs which will deference the NULL.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r56955 r56956  
     12010-04-01  Chris Evans  <cevans@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Add test for XSLT NULL crash:
     6        https://bugs.webkit.org/show_bug.cgi?id=36804
     7
     8        * LayoutTests/fast/xsl/xslt-bad-import-uri.html: added
     9        * LayoutTests/fast/xsl/xslt-bad-import-uri-expected.txt: added
     10        * LayoutTests/fast/xsl/resources/xslt-bad-import-uri.xml: added
     11        * LayoutTests/fast/xsl/resources/xslt-bad-import-uri.xsl: added
     12
    1132010-04-01  Alexey Proskuryakov  <ap@apple.com>
    214
  • trunk/WebCore/ChangeLog

    r56955 r56956  
     12010-04-01  Chris Evans  <cevans@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Fix a NULL pointer crash if @import fails to load a stylesheet.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=36804
     8
     9        Test: fast/xsl/xslt-bad-import-uri.html
     10
     11        * xml/XSLStyleSheetLibxslt.cpp:
     12        (WebCore::XSLStyleSheet::parseString):
     13          Handle an empty string gracefully. An empty string has a NULL
     14          buffer, which we pass in to xmlCreateMemoryParserCtxt(). It returns
     15          NULL if it is passed a NULL buffer.
     16          In the top-level XSL case, the current code does not crash "by luck"
     17          because the other APIs used can handle a NULL argument. In the
     18          @import case, additional code runs which will deference the NULL.
     19
    1202010-04-01  Alexey Proskuryakov  <ap@apple.com>
    221
  • trunk/WebCore/xml/XSLStyleSheetLibxslt.cpp

    r56825 r56956  
    155155
    156156    xmlParserCtxtPtr ctxt = xmlCreateMemoryParserCtxt(buffer, size);
     157    if (!ctxt)
     158        return 0;
    157159
    158160    if (m_parentStyleSheet) {
Note: See TracChangeset for help on using the changeset viewer.