rrichards               Tue Jul 31 15:07:54 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/simplexml      simplexml.c 
  Log:
  MFH: fix possible crash
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.33&r2=1.151.2.22.2.34&diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.33 
php-src/ext/simplexml/simplexml.c:1.151.2.22.2.34
--- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.33   Tue Jul 10 12:24:51 2007
+++ php-src/ext/simplexml/simplexml.c   Tue Jul 31 15:07:54 2007
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: simplexml.c,v 1.151.2.22.2.33 2007/07/10 12:24:51 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.151.2.22.2.34 2007/07/31 15:07:54 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1575,7 +1575,9 @@
                        newnode->ns = NULL;
                        nsptr = xmlNewNs(newnode, (xmlChar *)nsuri, prefix);
                } else {
-                       nsptr = xmlSearchNsByHref(node->doc, node, (xmlChar 
*)nsuri);
+                       if (node) {
+                               nsptr = xmlSearchNsByHref(node->doc, node, 
(xmlChar *)nsuri);
+                       }
                        if (nsptr == NULL) {
                                nsptr = xmlNewNs(newnode, (xmlChar *)nsuri, 
prefix);
                        }
@@ -2435,7 +2437,7 @@
 {
        php_info_print_table_start();
        php_info_print_table_header(2, "Simplexml support", "enabled");
-       php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.33 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.151.2.22.2.34 $");
        php_info_print_table_row(2, "Schema support",
 #ifdef LIBXML_SCHEMAS_ENABLED
                "enabled");

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to