From: Dmitry Stogov Date: Thu, 20 Mar 2014 13:26:20 +0000 (+0400) Subject: check if object store was freed before accessing particular object X-Git-Tag: POST_PHPNG_MERGE~412^2~255 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a9d21c14576b76bf1451357555a4210ee2150cf7;p=php check if object store was freed before accessing particular object --- diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c index bea503eb63..e79e604e54 100644 --- a/Zend/zend_gc.c +++ b/Zend/zend_gc.c @@ -641,9 +641,9 @@ ZEND_API int gc_collect_cycles(TSRMLS_D) if (p->u.v.type == IS_OBJECT) { zend_object *obj = (zend_object*)p; - if (obj->handlers->dtor_obj && - EG(objects_store).object_buckets && - IS_VALID(EG(objects_store).object_buckets[obj->handle]) && + if (EG(objects_store).object_buckets && + obj->handlers->dtor_obj && + IS_VALID(EG(objects_store).object_buckets[obj->handle]) && !(obj->gc.u.v.flags & IS_OBJ_DESTRUCTOR_CALLED)) { obj->gc.u.v.flags |= IS_OBJ_DESTRUCTOR_CALLED;