iliaa           Sat Oct  7 19:41:10 2006 UTC

  Modified files:              
    /php-src/ext/dom    document.c 
  Log:
  MFB: Added missing safety checks (Problem identified by Coverity scan)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/dom/document.c?r1=1.81&r2=1.82&diff_format=u
Index: php-src/ext/dom/document.c
diff -u php-src/ext/dom/document.c:1.81 php-src/ext/dom/document.c:1.82
--- php-src/ext/dom/document.c:1.81     Thu Oct  5 11:59:42 2006
+++ php-src/ext/dom/document.c  Sat Oct  7 19:41:10 2006
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: document.c,v 1.81 2006/10/05 11:59:42 rrichards Exp $ */
+/* $Id: document.c,v 1.82 2006/10/07 19:41:10 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);
        }
 }
@@ -1585,7 +1587,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;
                }
 
@@ -2154,7 +2158,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

Reply via email to