rrichards               Tue Jul 31 15:07:15 2007 UTC

  Modified files:              
    /php-src/ext/simplexml      simplexml.c 
  Log:
  fix possible crash
  
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.241&r2=1.242&diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.241 
php-src/ext/simplexml/simplexml.c:1.242
--- php-src/ext/simplexml/simplexml.c:1.241     Tue Jul 10 12:26:37 2007
+++ php-src/ext/simplexml/simplexml.c   Tue Jul 31 15:07:15 2007
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: simplexml.c,v 1.241 2007/07/10 12:26:37 rrichards Exp $ */
+/* $Id: simplexml.c,v 1.242 2007/07/31 15:07:15 rrichards Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1637,7 +1637,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);
                        }
@@ -2498,7 +2500,7 @@
 {
        php_info_print_table_start();
        php_info_print_table_header(2, "Simplexml support", "enabled");
-       php_info_print_table_row(2, "Revision", "$Revision: 1.241 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.242 $");
        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