• 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:
            * 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.
            Test: fast/xsl/xslt-bad-import-uri.html
            * xml/XSLStyleSheetLibxslt.cpp:
              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