From: Jan Kneschke Date: Fri, 22 Nov 2002 13:41:51 +0000 (+0000) Subject: - protect the function against a non-xml document X-Git-Tag: RELEASE_1_0b2~68 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4ced28d7c93bc4a23d07ae01dff6a8bbdda55ed;p=php - protect the function against a non-xml document - initializing variables reduces the number of seg-faults --- diff --git a/ext/soap/php_packet_soap.c b/ext/soap/php_packet_soap.c index 9a05e5ed97..21c65c98a0 100644 --- a/ext/soap/php_packet_soap.c +++ b/ext/soap/php_packet_soap.c @@ -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) {