File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,10 @@ static zend_object *spl_filesystem_object_new_ex(zend_class_entry *class_type)
155
155
{
156
156
spl_filesystem_object * intern ;
157
157
158
- intern = zend_object_alloc (sizeof (spl_filesystem_object ), class_type );
158
+ intern = emalloc (sizeof (spl_filesystem_object ) + zend_object_properties_size (class_type ));
159
+ memset (intern , 0 ,
160
+ MAX (XtOffsetOf (spl_filesystem_object , u .dir .entry ),
161
+ XtOffsetOf (spl_filesystem_object , u .file .escape ) + sizeof (int )));
159
162
/* intern->type = SPL_FS_INFO; done by set 0 */
160
163
intern -> file_class = spl_ce_SplFileObject ;
161
164
intern -> info_class = spl_ce_SplFileInfo ;
Original file line number Diff line number Diff line change @@ -68,13 +68,13 @@ struct _spl_filesystem_object {
68
68
union {
69
69
struct {
70
70
php_stream * dirp ;
71
- php_stream_dirent entry ;
72
71
zend_string * sub_path ;
73
72
int index ;
74
73
int is_recursive ;
75
74
zend_function * func_rewind ;
76
75
zend_function * func_next ;
77
76
zend_function * func_valid ;
77
+ php_stream_dirent entry ;
78
78
} dir ;
79
79
struct {
80
80
php_stream * stream ;
You can’t perform that action at this time.
0 commit comments