Skip to content

Commit

Permalink
Merge branch 'PHP-8.4'
Browse files Browse the repository at this point in the history
* PHP-8.4:
  Revert undoing of partial spl_filesystem_object initialization
  • Loading branch information
iluuu1994 committed Oct 17, 2024
2 parents 76138d6 + 1c542af commit ee41549
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ext/spl/spl_directory.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@ static zend_object *spl_filesystem_object_new(zend_class_entry *class_type)
{
spl_filesystem_object *intern;

intern = ecalloc(1, sizeof(spl_filesystem_object) + zend_object_properties_size(class_type));
intern = emalloc(sizeof(spl_filesystem_object) + zend_object_properties_size(class_type));
/* Avoid initializing the entirety of spl_filesystem_object.u.dir.entry. */
memset(intern, 0,
MAX(XtOffsetOf(spl_filesystem_object, u.dir.entry),
XtOffsetOf(spl_filesystem_object, u.file.escape) + sizeof(int)));
/* intern->type = SPL_FS_INFO; done by set 0 */
intern->file_class = spl_ce_SplFileObject;
intern->info_class = spl_ce_SplFileInfo;
Expand Down

0 comments on commit ee41549

Please sign in to comment.