From f2e88512451ba0d48252eaf206a0f242a8cd3ddb Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 1 Oct 2019 12:58:26 +0200 Subject: Remove func copy optimization for private method with static vars Not NULLing the static_variables pointer for shadow methods during static var shutdown would be a way to avoid this leak, but unless there's evidence that inherited private methods with static vars are actually a common use-case, I don't think we should keep this kind of fragile edge-case optimization. Fixes OSS-Fuzz #17875. --- Zend/zend_execute_API.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zend/zend_execute_API.c') diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 3c78d2524d..c2ab453485 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -302,7 +302,7 @@ void shutdown_executor(void) /* {{{ */ } if (ce->ce_flags & ZEND_HAS_STATIC_IN_METHODS) { zend_op_array *op_array; - ZEND_HASH_FOREACH_PTR(&ce->function_table, op_array) { + ZEND_HASH_FOREACH_PTR(&ce->function_table, op_array) { if (op_array->type == ZEND_USER_FUNCTION) { if (op_array->static_variables) { HashTable *ht = ZEND_MAP_PTR_GET(op_array->static_variables_ptr); -- cgit v1.2.1