From b4ced28d7c93bc4a23d07ae01dff6a8bbdda55ed Mon Sep 17 00:00:00 2001 From: Jan Kneschke Date: Fri, 22 Nov 2002 13:41:51 +0000 Subject: [PATCH] - protect the function against a non-xml document - initializing variables reduces the number of seg-faults --- ext/soap/php_packet_soap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) { -- 2.50.1