summaryrefslogtreecommitdiff
path: root/ext/soap/php_packet_soap.c
diff options
context:
space:
mode:
authorJan Kneschke <ostborn@php.net>2002-11-22 13:41:51 +0000
committerJan Kneschke <ostborn@php.net>2002-11-22 13:41:51 +0000
commitb4ced28d7c93bc4a23d07ae01dff6a8bbdda55ed (patch)
treef09fad355fd34e86268bd16e004b424a5b77c625 /ext/soap/php_packet_soap.c
parent3598fbcef9bb96a4fbe3b77c1f0d5eace9475940 (diff)
downloadphp-git-b4ced28d7c93bc4a23d07ae01dff6a8bbdda55ed.tar.gz
- protect the function against a non-xml document
- initializing variables reduces the number of seg-faults
Diffstat (limited to 'ext/soap/php_packet_soap.c')
-rw-r--r--ext/soap/php_packet_soap.c6
1 files changed, 5 insertions, 1 deletions
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)
{