summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott MacVicar <scottmac@php.net>2008-09-15 22:13:25 +0000
committerScott MacVicar <scottmac@php.net>2008-09-15 22:13:25 +0000
commitdb907e5bc37482d5a50dd5309f95a8bd41d10996 (patch)
tree07661bfa3aff00482a21fadfa2fed6d557a3c690
parent8bb2465a516361bf857b264a44aee0339774c72c (diff)
downloadphp-git-db907e5bc37482d5a50dd5309f95a8bd41d10996.tar.gz
Fixed bug #46086 (Segfault when accessing fileinfo class property)
-rw-r--r--NEWS3
-rw-r--r--ext/fileinfo/fileinfo.c14
2 files changed, 8 insertions, 9 deletions
diff --git a/NEWS b/NEWS
index aacd91b0ca..1296b8c4ee 100644
--- a/NEWS
+++ b/NEWS
@@ -2,9 +2,12 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 200?, PHP 5.3.0 Alpha 3
- Upgraded bundled PCRE to version 7.8. (Nuno)
+- Upgraded bundled sqlite to version 3.6.2. (Scott)
- Changed error level E_ERROR into E_WARNING in Soap extension methods
parameter validation. (Felipe)
+- Fixed bug #46086 (Segfault when accessing fileinfo class properties).
+ (Scott)
- Fixed bug #46072 (Compile failure under IRIX 6.5.30 building util.c) (Greg)
- Fixed bug #46060 (Phar::addEmptyDir() breaks) (Greg)
- Fixed bug #46042 (memory leaks with reflection of mb_convert_encoding()).
diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c
index 729f0ae988..5e0c07d2ed 100644
--- a/ext/fileinfo/fileinfo.c
+++ b/ext/fileinfo/fileinfo.c
@@ -100,15 +100,11 @@ PHP_FILEINFO_API zend_object_value finfo_objects_new(zend_class_entry *class_typ
zend_object_value retval;
struct finfo_object *intern;
- 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 = 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->ptr = NULL;
retval.handle = zend_objects_store_put(intern, finfo_objects_dtor, NULL, NULL TSRMLS_CC);