File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,11 @@ static zend_object *spl_filesystem_object_new(zend_class_entry *class_type)
187
187
{
188
188
spl_filesystem_object * intern ;
189
189
190
- intern = ecalloc (1 , sizeof (spl_filesystem_object ) + zend_object_properties_size (class_type ));
190
+ intern = emalloc (sizeof (spl_filesystem_object ) + zend_object_properties_size (class_type ));
191
+ /* Avoid initializing the entirety of spl_filesystem_object.u.dir.entry. */
192
+ memset (intern , 0 ,
193
+ MAX (XtOffsetOf (spl_filesystem_object , u .dir .entry ),
194
+ XtOffsetOf (spl_filesystem_object , u .file .escape ) + sizeof (int )));
191
195
/* intern->type = SPL_FS_INFO; done by set 0 */
192
196
intern -> file_class = spl_ce_SplFileObject ;
193
197
intern -> info_class = spl_ce_SplFileInfo ;
You can’t perform that action at this time.
0 commit comments