]> granicus.if.org Git - php/commitdiff
Clarify that location is required in do_request
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 10 Feb 2021 10:18:20 +0000 (11:18 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 10 Feb 2021 10:18:20 +0000 (11:18 +0100)
As far as I can tell, the location is always non-null here,
and the code wouldn't be able to meaningfully work without a
location.

ext/soap/soap.c

index 3334689ed9506a3e3220c8121235cc59a2767df7..3d76c0fc70b0dc1008524e5e1e700606e2dc0f80 100644 (file)
@@ -2215,11 +2215,7 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
 
                ZVAL_STRINGL(&func,"__doRequest",sizeof("__doRequest")-1);
                ZVAL_STRINGL(&params[0], buf, buf_size);
-               if (location == NULL) {
-                       ZVAL_NULL(&params[1]);
-               } else {
-                       ZVAL_STRING(&params[1], location);
-               }
+               ZVAL_STRING(&params[1], location);
                if (action == NULL) {
                        ZVAL_NULL(&params[2]);
                } else {
@@ -2371,6 +2367,7 @@ static void do_soap_call(zend_execute_data *execute_data,
 
                                if (location == NULL) {
                                        location = binding->location;
+                                       ZEND_ASSERT(location);
                                }
                                if (binding->bindingType == BINDING_SOAP) {
                                        sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)fn->bindingAttributes;