diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2006-10-07 19:40:58 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2006-10-07 19:40:58 +0000 |
commit | 12f7021e121d936101ae03aab358f626b8d1cdbc (patch) | |
tree | 362041857bdd28b0af532bbf99d7be78896c98f2 | |
parent | 34ed116e90809d9d164021bdd2f73bb38b84e571 (diff) | |
download | php-git-12f7021e121d936101ae03aab358f626b8d1cdbc.tar.gz |
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 8bbd469657..a8202dd637 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); } } @@ -1568,7 +1570,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; } @@ -2069,7 +2073,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; } |