]> granicus.if.org Git - php/commitdiff
fix issues identitified by coverity
authorRob Richards <rrichards@php.net>
Thu, 21 Dec 2006 12:51:26 +0000 (12:51 +0000)
committerRob Richards <rrichards@php.net>
Thu, 21 Dec 2006 12:51:26 +0000 (12:51 +0000)
ext/dom/domimplementation.c
ext/dom/text.c

index f65da0572bc6b78433d0db99856ce4a4d26c469d..9c1613bf848cfe12530c95607fc91b4429857350 100644 (file)
@@ -115,6 +115,11 @@ PHP_METHOD(domimplementation, createDocumentType)
        doctype = xmlCreateIntSubset(NULL, localname, pch1, pch2);
        xmlFree(localname);
 
+       if (doctype == NULL) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create DocumentType");
+               RETURN_FALSE;
+       }
+
        DOM_RET_OBJ(rv, (xmlNodePtr) doctype, &ret, NULL);
 }
 /* }}} end dom_domimplementation_create_document_type */
index 9124de9ea5e6e232c2540256c378239d3e2cc30e..f62390ba16755801e8cf119e79abf7bcc5cbce34 100644 (file)
@@ -156,6 +156,10 @@ PHP_FUNCTION(dom_text_split_text)
        xmlFree(first);
        xmlFree(second);
 
+       if (nnode == NULL) {
+               RETURN_FALSE;
+       }
+
        if (node->parent != NULL) {
                nnode->type = XML_ELEMENT_NODE;
                xmlAddNextSibling(node, nnode);