History log of /php-src/ext/com_dotnet/tests/saproxy_instantiate.phpt (Results 1 – 1 of 1)
Revision Date Author Comments
# 2f52dbd7 07-Oct-2024 Christoph M. Becker

Prevent direct instantiation of com_safearray_proxy (GH-10278)

* Prevent direct instantiation of com_safearray_proxy

The `com_safearray_proxy` class is meant for internal usage, but

Prevent direct instantiation of com_safearray_proxy (GH-10278)

* Prevent direct instantiation of com_safearray_proxy

The `com_safearray_proxy` class is meant for internal usage, but so far
it was possible to instantiate it from userland, although that made no
sense. However, a while ago there was a relevant change[1], namely
that its `default_object_handlers` are now assigned when the class is
registered, while previously they only have been assigned when an
instance had been created internally. So now when freeing a manually
created object, `free_obj()` is called, although the object never has
been properly initialized (causing segfaults).

We fix this by introducing a `create_object()` handler which properly
initializes the object with dummy values. Since a manually created
`com_safearray_proxy` still does not make sense, we disallow its
instantiation.

[1] <https://github.com/php/php-src/commit/94ee4f9834743ca74f6c9653863273277ce6c61a>

Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>

show more ...