com php-src: Fix #78650: new COM Crash: NEWS ext/com_dotnet/c om_handlers.c ext/com_dotnet/tests/bug78650 .phpt

From: Date: Wed, 09 Oct 2019 12:09:02 +0000
Subject: com php-src: Fix #78650: new COM Crash: NEWS ext/com_dotnet/c om_handlers.c ext/com_dotnet/tests/bug78650 .phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-108823@lists.php.net to get a copy of this message
Commit: 4625fa181fd5e1c9b3d8ef291c7003bf51a70512 Author: Christoph M. Becker <cmbecker69@gmx.de> Wed, 9 Oct 2019 14:03:36 +0200 Parents: 8b5c351154284a88152ee3d166a32dc77316a658 Branches: PHP-7.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4625fa181fd5e1c9b3d8ef291c7003bf51a70512 Log: Fix #78650: new COM Crash As of PHP 7.4.0, the get_property_ptr_ptr handler is mandatory; we implement it to always return NULL, which is equivalent to not setting the handler in former versions. We add a portable and faster test case than what has been presented in the bug ticket. Bugs: https://bugs.php.net/78650 Changed paths: M NEWS M ext/com_dotnet/com_handlers.c A ext/com_dotnet/tests/bug78650.phpt Diff: diff --git a/NEWS b/NEWS index ff37a024b12..2a54015954d 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,9 @@ PHP NEWS . Fixed bug #78644 (SEGFAULT in ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER). (Nikita) +- COM: + . Fixed bug #78650 (new COM Crash). (cmb) + - Iconv: . Fixed bug #78642 (Wrong libiconv version displayed). (gedas at martynas, cmb). diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index 0a4693fec5f..8a70e60d764 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -174,6 +174,11 @@ static void com_write_dimension(zval *object, zval *offset, zval *value) } } +static zval *com_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot) +{ + return NULL; +} + #if 0 static void com_object_set(zval **property, zval *value) { @@ -546,7 +551,7 @@ zend_object_handlers php_com_object_handlers = { com_property_write, com_read_dimension, com_write_dimension, - NULL, + com_get_property_ptr_ptr, NULL, /* com_object_get, */ NULL, /* com_object_set, */ com_property_exists, diff --git a/ext/com_dotnet/tests/bug78650.phpt b/ext/com_dotnet/tests/bug78650.phpt new file mode 100644 index 00000000000..c362de95bbe --- /dev/null +++ b/ext/com_dotnet/tests/bug78650.phpt @@ -0,0 +1,27 @@ +--TEST-- +Bug #78650 (new COM Crash) +--SKIPIF-- +<?php +if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available'); +?> +--FILE-- +<?php +$fname = __DIR__ . '/bug78650/foo/bar'; +mkdir($fname, 0777, true); + +$fso = new COM("Scripting.FileSystemObject"); +$folder = $fso->GetFolder($fname); +$folder->ParentFolder->Name = 'baz'; + +print('OK'); +?> +--EXPECT-- +OK +--CLEAN-- +<?php +rmdir(__DIR__ . '/bug78650/baz/bar'); +rmdir(__DIR__ . '/bug78650/foo/bar'); +rmdir(__DIR__ . '/bug78650/baz'); +rmdir(__DIR__ . '/bug78650/foo'); +rmdir(__DIR__ . '/bug78650'); +?>

« previous php.cvs (#108823) next »