From 9d974aa1dd20212e5c9d954ea0287e41f6cbbc89 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 22 Oct 2020 10:35:03 +0200 Subject: [PATCH] Don't allow properties on former resource objects --- ext/gd/gd.c | 4 ++-- ext/pspell/pspell.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 26eff9730c..efc296d18f 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -281,7 +281,7 @@ static void php_gd_font_object_free(zend_object *zobj) static zend_function *php_gd_font_object_get_constructor(zend_object *object) { - zend_throw_error(NULL, "You cannot initialize a GdImage object except through helper functions"); + zend_throw_error(NULL, "You cannot initialize a GdFont object except through helper functions"); return NULL; } @@ -290,7 +290,7 @@ static void php_gd_font_minit_helper() zend_class_entry ce; INIT_CLASS_ENTRY(ce, "GdFont", class_GdFont_methods); gd_font_ce = zend_register_internal_class(&ce); - gd_font_ce->ce_flags |= ZEND_ACC_FINAL; + gd_font_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES; gd_font_ce->create_object = php_gd_font_object_create; gd_font_ce->serialize = zend_class_serialize_deny; gd_font_ce->unserialize = zend_class_unserialize_deny; diff --git a/ext/pspell/pspell.c b/ext/pspell/pspell.c index 34859076a2..4253f5f159 100644 --- a/ext/pspell/pspell.c +++ b/ext/pspell/pspell.c @@ -153,7 +153,7 @@ static PHP_MINIT_FUNCTION(pspell) zend_class_entry ce; INIT_CLASS_ENTRY(ce, "PSpell", class_PSpell_methods); php_pspell_ce = zend_register_internal_class(&ce); - php_pspell_ce->ce_flags |= ZEND_ACC_FINAL; + php_pspell_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES; php_pspell_ce->create_object = php_pspell_object_create; php_pspell_ce->serialize = zend_class_serialize_deny; php_pspell_ce->unserialize = zend_class_unserialize_deny; @@ -166,7 +166,7 @@ static PHP_MINIT_FUNCTION(pspell) INIT_CLASS_ENTRY(ce, "PSpellConfig", class_PSpellConfig_methods); php_pspell_config_ce = zend_register_internal_class(&ce); - php_pspell_config_ce->ce_flags |= ZEND_ACC_FINAL; + php_pspell_config_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES; php_pspell_config_ce->create_object = php_pspell_config_object_create; php_pspell_config_ce->serialize = zend_class_serialize_deny; php_pspell_config_ce->unserialize = zend_class_unserialize_deny; -- 2.50.1