Skip to content
  • eric@webkit.org's avatar
    2010-04-01 Chris Evans <cevans@chromium.org> · 0f70efe2
    eric@webkit.org authored
            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.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@56956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    0f70efe2