From: Scott MacVicar Date: Mon, 15 Sep 2008 22:15:16 +0000 (+0000) Subject: MFB Fixed bug #46086 (Segfault when accessing fileinfo class property) X-Git-Tag: BEFORE_HEAD_NS_CHANGE~377 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71d0a46269dc0e0e1690cba72f138b73b4f3a4d1;p=php MFB Fixed bug #46086 (Segfault when accessing fileinfo class property) --- diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c index 9695bad672..1b89036efe 100644 --- a/ext/fileinfo/fileinfo.c +++ b/ext/fileinfo/fileinfo.c @@ -99,16 +99,13 @@ PHP_FILEINFO_API zend_object_value finfo_objects_new(zend_class_entry *class_typ { zend_object_value retval; struct finfo_object *intern; + zval *tmp; + + intern = emalloc(sizeof(struct finfo_object)); + + zend_object_std_init(&intern->zo, class_type TSRMLS_CC); + zend_hash_copy(intern->zo.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref,(void *) &tmp, sizeof(zval *)); - intern = ecalloc(1, sizeof(struct finfo_object)); - intern->zo.ce = class_type; - intern->zo.properties = NULL; -#if ZEND_MODULE_API_NO >= 20050922 - intern->zo.guards = NULL; -#else - intern->zo.in_get = 0; - intern->zo.in_set = 0; -#endif intern->ptr = NULL; retval.handle = zend_objects_store_put(intern, finfo_objects_dtor, NULL, NULL TSRMLS_CC);