From: Michael Wallner Date: Fri, 24 Feb 2006 10:24:43 +0000 (+0000) Subject: - MF51: fix crash in DOMImplementation::createDocumentType("name:") X-Git-Tag: RELEASE_1_2~99 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=92f97ce76a551d744e22edb9e5175abf9200540a;p=php - MF51: fix crash in DOMImplementation::createDocumentType("name:") --- diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c index aa371f8154..f65da0572b 100644 --- a/ext/dom/domimplementation.c +++ b/ext/dom/domimplementation.c @@ -92,7 +92,7 @@ PHP_METHOD(domimplementation, createDocumentType) pch2 = systemid; uri = xmlParseURI(name); - if (uri->opaque != NULL) { + if (uri != NULL && uri->opaque != NULL) { localname = xmlStrdup(uri->opaque); if (xmlStrchr(localname, (xmlChar) ':') != NULL) { php_dom_throw_error(NAMESPACE_ERR, 1 TSRMLS_CC); @@ -108,7 +108,9 @@ PHP_METHOD(domimplementation, createDocumentType) php_dom_throw_error(INVALID_CHARACTER_ERR, TSRMLS_CC); */ - xmlFreeURI(uri); + if (uri) { + xmlFreeURI(uri); + } doctype = xmlCreateIntSubset(NULL, localname, pch1, pch2); xmlFree(localname);