Skip to content

Commit

Permalink
Check zpp before other errors in SoapServer::addSoapHeader()
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Aug 30, 2019
1 parent 82d9f14 commit ec92975
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ext/soap/soap.c
Expand Up @@ -2012,17 +2012,17 @@ PHP_METHOD(SoapServer, addSoapHeader)

SOAP_SERVER_BEGIN_CODE();

if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &fault, soap_header_class_entry) == FAILURE) {
return;
}

FETCH_THIS_SERVICE(service);

if (!service || !service->soap_headers_ptr) {
php_error_docref(NULL, E_WARNING, "The SoapServer::addSoapHeader function may be called only during SOAP request processing");
return;
}

if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &fault, soap_header_class_entry) == FAILURE) {
return;
}

p = service->soap_headers_ptr;
while (*p != NULL) {
p = &(*p)->next;
Expand Down

0 comments on commit ec92975

Please sign in to comment.