Merge branch 'PHP-8.3' into PHP-8.4

* PHP-8.3:
  Fix GH-16991: Getting typeinfo of non DISPATCH variant segfaults
This commit is contained in:
Christoph M. Becker 2024-11-29 16:31:00 +01:00
commit 8ea042d954
No known key found for this signature in database
GPG key ID: D66C9593118BCCB6
3 changed files with 15 additions and 1 deletions

4
NEWS
View file

@ -6,6 +6,10 @@ PHP NEWS
. Fixed bug GH-16978 (Avoid unnecessary padding with leading zeros)
(Saki Takamachi)
- COM:
. Fixed bug GH-16991 (Getting typeinfo of non DISPATCH variant segfaults).
(cmb)
- Core:
. Fixed bug GH-16344 (setRawValueWithoutLazyInitialization() and
skipLazyInitialization() may change initialized proxy). (Arnaud)

View file

@ -331,7 +331,7 @@ ITypeInfo *php_com_locate_typeinfo(zend_string *type_lib_name, php_com_dotnet_ob
if (obj->typeinfo) {
ITypeInfo_AddRef(obj->typeinfo);
return obj->typeinfo;
} else {
} else if (V_VT(&obj->v) == VT_DISPATCH) {
IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &typeinfo);
if (typeinfo) {
return typeinfo;

View file

@ -0,0 +1,10 @@
--TEST--
GH-16991 (Getting typeinfo of non DISPATCH variant segfaults)
--EXTENSIONS--
com_dotnet
--FILE--
<?php
com_print_typeinfo(new variant("hello"));
?>
--EXPECTF--
Warning: com_print_typeinfo(): Unable to find typeinfo using the parameters supplied in %s on line %d