mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Revert undoing of partial spl_filesystem_object initialization
We're intentionally not initializing spl_filesystem_object.u.dir.entry, as it will later be initialized, and we don't need to zero the entire buffer anyway.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user