From 867b39d111df47d7cfd2aee90e8dd42d75ee0e7e Mon Sep 17 00:00:00 2001 From: Rob Richards Date: Thu, 21 Dec 2006 12:52:12 +0000 Subject: [PATCH] MFB: fix issues identitified by coverity --- ext/dom/domimplementation.c | 5 +++++ ext/dom/text.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c index 88b38ba878..42fec7bd60 100644 --- a/ext/dom/domimplementation.c +++ b/ext/dom/domimplementation.c @@ -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 */ diff --git a/ext/dom/text.c b/ext/dom/text.c index a47fad0212..11bf6fb9aa 100644 --- a/ext/dom/text.c +++ b/ext/dom/text.c @@ -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); -- 2.50.1