]> granicus.if.org Git - php/commitdiff
- protect the function against a non-xml document
authorJan Kneschke <ostborn@php.net>
Fri, 22 Nov 2002 13:41:51 +0000 (13:41 +0000)
committerJan Kneschke <ostborn@php.net>
Fri, 22 Nov 2002 13:41:51 +0000 (13:41 +0000)
- initializing variables reduces the number of seg-faults

ext/soap/php_packet_soap.c

index 9a05e5ed97907bb2f7299f70287de5d6ea8c1bac..21c65c98a00ab9fbf8957413825323d1ac50ceab 100644 (file)
@@ -9,6 +9,10 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
 
        response = xmlParseMemory(buffer, buffer_size);
        xmlCleanupParser();
+       
+       if (!response) {
+               php_error(E_ERROR, "looks like we got no XML document");
+       }
 
        (*num_params) = 0;
 
@@ -55,7 +59,7 @@ int parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunction
                                        sdlParamPtr *h_param, param = NULL;
                                        xmlNodePtr val = NULL;
                                        encodePtr enc;
-                                       char *name, *ns;
+                                       char *name, *ns = NULL;
 
                                        if(fn->bindingType == BINDING_SOAP)
                                        {