mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
ext/soap: Check services are not empty via an if guard
This commit is contained in:
parent
81132bb2f4
commit
f0a35e2cd2
1 changed files with 10 additions and 10 deletions
|
@ -708,11 +708,14 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
|
|||
zend_hash_init(&ctx.services, 0, NULL, NULL, 0);
|
||||
|
||||
zend_try {
|
||||
load_wsdl_ex(this_ptr, struri, &ctx, false);
|
||||
schema_pass2(&ctx);
|
||||
load_wsdl_ex(this_ptr, struri, &ctx, false);
|
||||
schema_pass2(&ctx);
|
||||
|
||||
uint32_t n = zend_hash_num_elements(&ctx.services);
|
||||
if (n == 0) {
|
||||
soap_error0(E_ERROR, "Parsing WSDL: Couldn't bind to service");
|
||||
}
|
||||
|
||||
uint32_t n = zend_hash_num_elements(&ctx.services);
|
||||
if (n > 0) {
|
||||
zend_hash_internal_pointer_reset(&ctx.services);
|
||||
for (uint32_t i = 0; i < n; i++) {
|
||||
xmlNodePtr service, tmp;
|
||||
|
@ -1126,13 +1129,10 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
|
|||
|
||||
zend_hash_move_forward(&ctx.services);
|
||||
}
|
||||
} else {
|
||||
soap_error0(E_ERROR, "Parsing WSDL: Couldn't bind to service");
|
||||
}
|
||||
|
||||
if (ctx.sdl->bindings == NULL || ctx.sdl->bindings->nNumOfElements == 0) {
|
||||
soap_error0(E_ERROR, "Parsing WSDL: Could not find any usable binding services in WSDL.");
|
||||
}
|
||||
if (ctx.sdl->bindings == NULL || ctx.sdl->bindings->nNumOfElements == 0) {
|
||||
soap_error0(E_ERROR, "Parsing WSDL: Could not find any usable binding services in WSDL.");
|
||||
}
|
||||
|
||||
} zend_catch {
|
||||
/* Avoid persistent memory leak. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue