Fix missing string copy

I changed this to a zend_string_copy, but that's not correct in
this case, as we still append to the string below.

Also fix a test on 32-bit.
This commit is contained in:
Nikita Popov 2021-08-20 13:58:03 +02:00
parent 50484b59cd
commit de6cf68ac4
2 changed files with 4 additions and 2 deletions

View file

@ -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);

View file

@ -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}