diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2018-11-23 16:32:33 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2018-11-23 16:32:33 +0100 |
commit | 115ee49b0be12e3df7d2c7027609fbe1a1297e42 (patch) | |
tree | 6351c4b6b9c5e09c8a699613237afae1fa908975 /ext/com_dotnet/com_handlers.c | |
parent | f2de4d185d9c4a2bb8d7e0a617c5a91496ea1ed9 (diff) | |
download | php-git-115ee49b0be12e3df7d2c7027609fbe1a1297e42.tar.gz |
Fix #77177: Serializing or unserializing COM objects crashes
Firstly, we avoid returning NULL from the get_property handler, but
instead return an empty HashTable, which already prevents the crashes.
Secondly, since (de-)serialization obviously makes no sense for COM,
DOTNET and VARIANT objects (at least with the current implementation),
we prohibit it right away.
Diffstat (limited to 'ext/com_dotnet/com_handlers.c')
-rw-r--r-- | ext/com_dotnet/com_handlers.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index fd9cdf22b0..1fc6c04c9a 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -29,6 +29,8 @@ #include "php_com_dotnet_internal.h" #include "Zend/zend_exceptions.h" +const HashTable com_dotnet_object_properties; + static zval *com_property_read(zval *object, zval *member, int type, void **cahce_slot, zval *rv) { php_com_dotnet_object *obj; @@ -231,7 +233,7 @@ static HashTable *com_properties_get(zval *object) * infinite recursion when the hash is displayed via var_dump(). * Perhaps it is best to leave it un-implemented. */ - return NULL; + return &com_dotnet_object_properties; } static void function_dtor(zval *zv) |