diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2019-03-18 19:27:38 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2019-03-18 19:27:38 +0100 |
commit | ef25de3e4e503a361a25fb14bd830dcaac98713e (patch) | |
tree | 5418cc0976e10177e37168a353653d13f0ed012b /ext/com_dotnet | |
parent | d52894dd58dbc16fddadc67e72b7b00860729dfc (diff) | |
parent | fb51f2c7ba70ef316eabce5d74ac0337fd3389d2 (diff) | |
download | php-git-ef25de3e4e503a361a25fb14bd830dcaac98713e.tar.gz |
Merge branch 'PHP-7.4'
* PHP-7.4:
Fix #77578: Crash when php unload
Diffstat (limited to 'ext/com_dotnet')
-rw-r--r-- | ext/com_dotnet/com_typeinfo.c | 4 | ||||
-rw-r--r-- | ext/com_dotnet/tests/bug77578.phpt | 23 |
2 files changed, 25 insertions, 2 deletions
diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c index 517e04ed5c..d5afd57a89 100644 --- a/ext/com_dotnet/com_typeinfo.c +++ b/ext/com_dotnet/com_typeinfo.c @@ -216,8 +216,8 @@ PHP_COM_DOTNET_API int php_com_import_typelib(ITypeLib *TL, int mode, int codepa /* Type-library stuff */ void php_com_typelibrary_dtor(zval *pDest) { - ITypeLib **Lib = (ITypeLib**)Z_PTR_P(pDest); - ITypeLib_Release(*Lib); + ITypeLib *Lib = (ITypeLib*)Z_PTR_P(pDest); + ITypeLib_Release(Lib); } PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string, diff --git a/ext/com_dotnet/tests/bug77578.phpt b/ext/com_dotnet/tests/bug77578.phpt new file mode 100644 index 0000000000..e68494468e --- /dev/null +++ b/ext/com_dotnet/tests/bug77578.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #77578 (Crash when php unload) +--SKIPIF-- +<?php +if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available'); +?> +--FILE-- +<?php +// To actually be able to verify the crash during shutdown on Windows, we have +// to execute a PHP subprocess, and check its exit status. +$php = PHP_BINARY; +$ini = php_ini_loaded_file(); +$iniopt = $ini ? "-c $ini" : ''; +$command = "$php $iniopt -d com.autoregister_typelib=1 -r \"new COM('WbemScripting.SWbemLocator');\""; +exec($command, $output, $status); +var_dump($output, $status); +?> +===DONE=== +--EXPECT-- +array(0) { +} +int(0) +===DONE=== |