1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.4'

* PHP-8.4:
  Revert undoing of partial spl_filesystem_object initialization
This commit is contained in:
Ilija Tovilo
2024-10-17 18:44:50 +02:00

View File

@@ -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;