diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index c1dd29e828e..2f4ee5150ca 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -861,7 +861,9 @@ try_again: smart_str_0(&soap_headers); if (Z_TYPE_P(Z_CLIENT_TRACE_P(this_ptr)) == IS_TRUE) { zval_ptr_dtor(Z_CLIENT_LAST_REQUEST_HEADERS_P(this_ptr)); - ZVAL_STR_COPY(Z_CLIENT_LAST_REQUEST_HEADERS_P(this_ptr), soap_headers.s); + /* Need to copy the string here, as we continue appending to soap_headers below. */ + ZVAL_STRINGL(Z_CLIENT_LAST_REQUEST_HEADERS_P(this_ptr), + ZSTR_VAL(soap_headers.s), ZSTR_LEN(soap_headers.s)); } smart_str_appendl(&soap_headers, request->val, request->len); smart_str_0(&soap_headers); diff --git a/ext/soap/tests/bug73452.phpt b/ext/soap/tests/bug73452.phpt index 3383ee2994a..d818ba15f49 100644 --- a/ext/soap/tests/bug73452.phpt +++ b/ext/soap/tests/bug73452.phpt @@ -11,7 +11,7 @@ echo unserialize($data); ?> ==DONE== --EXPECTF-- -Fatal error: Uncaught TypeError: Cannot assign int to property SoapFault::$faultcode of type ?string in %s:%d +Fatal error: Uncaught TypeError: Cannot assign %s to property SoapFault::$faultcode of type ?string in %s:%d Stack trace: #0 %sbug73452.php(4): unserialize('O:9:"SoapFault"...') #1 {main}