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

index 88b38ba87869068158285972bb8bb6eaec049f5a..42fec7bd60eed55eaa299a180d67173f50da8f82 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 a47fad0212e3e2e2cf27cd059835328565350a2f..11bf6fb9aa38186d44a65f0635db6fc8a4c3e96d 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);