iliaa Sat Oct 7 19:40:59 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/dom document.c Log: Added missing safety checks (Problem identified by Coverity scan) http://cvs.php.net/viewvc.cgi/php-src/ext/dom/document.c?r1=1.68.2.3.2.3&r2=1.68.2.3.2.4&diff_format=u Index: php-src/ext/dom/document.c diff -u php-src/ext/dom/document.c:1.68.2.3.2.3 php-src/ext/dom/document.c:1.68.2.3.2.4 --- php-src/ext/dom/document.c:1.68.2.3.2.3 Sat Sep 16 19:07:35 2006 +++ php-src/ext/dom/document.c Sat Oct 7 19:40:58 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: document.c,v 1.68.2.3.2.3 2006/09/16 19:07:35 iliaa Exp $ */ +/* $Id: document.c,v 1.68.2.3.2.4 2006/10/07 19:40:58 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1355,7 +1355,9 @@ } } 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 @@ } } 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 @@ } } 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; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php