diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2006-10-07 19:41:10 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2006-10-07 19:41:10 +0000 |
commit | 4ad5333dd57cd545d20d0a9debc62152ceaa6de8 (patch) | |
tree | 0d4827625ca2ad4d960f31a2c6ce863f9a90a9c3 | |
parent | 80945c4914fe09a0bcd2f627a5a4c2050b5a3424 (diff) | |
download | php-git-4ad5333dd57cd545d20d0a9debc62152ceaa6de8.tar.gz |
MFB: Added missing safety checks (Problem identified by Coverity scan)
-rw-r--r-- | ext/dom/document.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ext/dom/document.c b/ext/dom/document.c index 4d05da87d8..8bebb417e0 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -1355,7 +1355,9 @@ PHP_METHOD(domdocument, __construct) } } intern->document = NULL; - php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp TSRMLS_CC); + if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp TSRMLS_CC) == -1) { + RETURN_FALSE; + } php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)docp, (void *)intern TSRMLS_CC); } } @@ -1585,7 +1587,9 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) { } } intern->document = NULL; - php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC); + if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC) == -1) { + RETURN_FALSE; + } intern->document->doc_props = doc_prop; } @@ -2154,7 +2158,9 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) } } intern->document = NULL; - php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC); + if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC) == -1) { + RETURN_FALSE; + } intern->document->doc_props = doc_prop; } |