ext/soap: Check services are not empty via an if guard

This commit is contained in:
Gina Peter Banyard 2024-10-16 16:06:47 +01:00
parent 81132bb2f4
commit f0a35e2cd2

View file

@ -712,7 +712,10 @@ static sdlPtr load_wsdl(zval *this_ptr, char *struri)
schema_pass2(&ctx);
uint32_t n = zend_hash_num_elements(&ctx.services);
if (n > 0) {
if (n == 0) {
soap_error0(E_ERROR, "Parsing WSDL: Couldn't bind to service");
}
zend_hash_internal_pointer_reset(&ctx.services);
for (uint32_t i = 0; i < n; i++) {
xmlNodePtr service, tmp;
@ -1126,9 +1129,6 @@ 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.");