mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix GH-16256: Assertion failure in ext/soap/php_encoding.c:460
This commit is contained in:
commit
2dbc605686
3 changed files with 33 additions and 0 deletions
2
NEWS
2
NEWS
|
@ -81,6 +81,8 @@ PHP NEWS
|
||||||
(nielsdos)
|
(nielsdos)
|
||||||
. Fixed bug GH-16237 (Segmentation fault when cloning SoapServer). (nielsdos)
|
. Fixed bug GH-16237 (Segmentation fault when cloning SoapServer). (nielsdos)
|
||||||
. Fix Soap leaking http_msg on error. (nielsdos)
|
. Fix Soap leaking http_msg on error. (nielsdos)
|
||||||
|
. Fixed bug GH-16256 (Assertion failure in ext/soap/php_encoding.c:460).
|
||||||
|
(nielsdos)
|
||||||
|
|
||||||
- SPL:
|
- SPL:
|
||||||
. Fixed bug GH-15918 (Assertion failure in ext/spl/spl_fixedarray.c).
|
. Fixed bug GH-15918 (Assertion failure in ext/spl/spl_fixedarray.c).
|
||||||
|
|
|
@ -838,6 +838,9 @@ PHP_METHOD(SoapServer, __construct)
|
||||||
|
|
||||||
if ((tmp = zend_hash_str_find(ht, "classmap", sizeof("classmap")-1)) != NULL &&
|
if ((tmp = zend_hash_str_find(ht, "classmap", sizeof("classmap")-1)) != NULL &&
|
||||||
Z_TYPE_P(tmp) == IS_ARRAY) {
|
Z_TYPE_P(tmp) == IS_ARRAY) {
|
||||||
|
if (HT_IS_PACKED(Z_ARRVAL_P(tmp))) {
|
||||||
|
php_error_docref(NULL, E_ERROR, "'classmap' option must be an associative array");
|
||||||
|
}
|
||||||
service->class_map = zend_array_dup(Z_ARRVAL_P(tmp));
|
service->class_map = zend_array_dup(Z_ARRVAL_P(tmp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2004,6 +2007,9 @@ PHP_METHOD(SoapClient, __construct)
|
||||||
}
|
}
|
||||||
if ((tmp = zend_hash_str_find(ht, "classmap", sizeof("classmap")-1)) != NULL &&
|
if ((tmp = zend_hash_str_find(ht, "classmap", sizeof("classmap")-1)) != NULL &&
|
||||||
Z_TYPE_P(tmp) == IS_ARRAY) {
|
Z_TYPE_P(tmp) == IS_ARRAY) {
|
||||||
|
if (HT_IS_PACKED(Z_ARRVAL_P(tmp))) {
|
||||||
|
php_error_docref(NULL, E_ERROR, "'classmap' option must be an associative array");
|
||||||
|
}
|
||||||
ZVAL_COPY(Z_CLIENT_CLASSMAP_P(this_ptr), tmp);
|
ZVAL_COPY(Z_CLIENT_CLASSMAP_P(this_ptr), tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
25
ext/soap/tests/bugs/gh16256.phpt
Normal file
25
ext/soap/tests/bugs/gh16256.phpt
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
--TEST--
|
||||||
|
GH-16256 (Assertion failure in ext/soap/php_encoding.c:460)
|
||||||
|
--EXTENSIONS--
|
||||||
|
soap
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
$classmap = [
|
||||||
|
"bogus",
|
||||||
|
];
|
||||||
|
$wsdl = __DIR__."/ext/soap/tests/bug41004.wsdl";
|
||||||
|
try {
|
||||||
|
new SoapClient($wsdl, ["classmap" => $classmap]);
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
echo $e->getMessage(), "\n";
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
new SoapServer($wsdl, ["classmap" => $classmap]);
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
echo $e->getMessage(), "\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
SoapClient::__construct(): 'classmap' option must be an associative array
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>SoapServer::__construct(): 'classmap' option must be an associative array</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
|
Loading…
Add table
Add a link
Reference in a new issue