summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-05-31 11:57:22 +0300
committerDmitry Stogov <dmitry@zend.com>2018-05-31 11:57:22 +0300
commitf2b4ec4bdc595773fb49b7d6ae8942c61f436288 (patch)
tree528873c7a446929a9298aaaaad4b6cef805fdc69 /ext/zip/php_zip.c
parent0d72bb8fcb0b2d658f9a40e473207f4a1f66df91 (diff)
downloadphp-git-f2b4ec4bdc595773fb49b7d6ae8942c61f436288.tar.gz
Export standard object handlers, to avoid indirect access
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r--ext/zip/php_zip.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index a98c8cc555..0aaef7d21a 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -878,7 +878,6 @@ static zval *php_zip_get_property_ptr_ptr(zval *object, zval *member, int type,
zval tmp_member;
zval *retval = NULL;
zip_prop_handler *hnd = NULL;
- const zend_object_handlers *std_hnd;
if (Z_TYPE_P(member) != IS_STRING) {
ZVAL_STR(&tmp_member, zval_get_string_func(member));
@@ -893,8 +892,7 @@ static zval *php_zip_get_property_ptr_ptr(zval *object, zval *member, int type,
}
if (hnd == NULL) {
- std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->get_property_ptr_ptr(object, member, type, cache_slot);
+ retval = zend_std_get_property_ptr_ptr(object, member, type, cache_slot);
}
if (member == &tmp_member) {
@@ -911,7 +909,6 @@ static zval *php_zip_read_property(zval *object, zval *member, int type, void **
zval tmp_member;
zval *retval = NULL;
zip_prop_handler *hnd = NULL;
- const zend_object_handlers *std_hnd;
if (Z_TYPE_P(member) != IS_STRING) {
ZVAL_STR(&tmp_member, zval_get_string_func(member));
@@ -931,8 +928,7 @@ static zval *php_zip_read_property(zval *object, zval *member, int type, void **
retval = &EG(uninitialized_zval);
}
} else {
- std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->read_property(object, member, type, cache_slot, rv);
+ retval = zend_std_read_property(object, member, type, cache_slot, rv);
}
if (member == &tmp_member) {
@@ -948,7 +944,6 @@ static int php_zip_has_property(zval *object, zval *member, int type, void **cac
ze_zip_object *obj;
zval tmp_member;
zip_prop_handler *hnd = NULL;
- const zend_object_handlers *std_hnd;
int retval = 0;
if (Z_TYPE_P(member) != IS_STRING) {
@@ -978,8 +973,7 @@ static int php_zip_has_property(zval *object, zval *member, int type, void **cac
zval_ptr_dtor(&tmp);
} else {
- std_hnd = zend_get_std_object_handlers();
- retval = std_hnd->has_property(object, member, type, cache_slot);
+ retval = zend_std_has_property(object, member, type, cache_slot);
}
if (member == &tmp_member) {
@@ -3156,7 +3150,7 @@ static PHP_MINIT_FUNCTION(zip)
{
zend_class_entry ce;
- memcpy(&zip_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+ memcpy(&zip_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
zip_object_handlers.offset = XtOffsetOf(ze_zip_object, zo);
zip_object_handlers.free_obj = php_zip_object_free_storage;
zip_object_handlers.clone_obj = NULL;