From: Antony Dovgal Date: Thu, 2 Feb 2006 12:19:14 +0000 (+0000) Subject: fix #36258 (SplFileObject::getPath() may lead to segfault) X-Git-Tag: php-5.1.3RC1~172 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0506d1a9f5a3ab72b9465ded775552771ac5aa78;p=php fix #36258 (SplFileObject::getPath() may lead to segfault) --- diff --git a/NEWS b/NEWS index 4bfc8ababe..2a6f4b1751 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,7 @@ PHP NEWS - Added imap_savebody() that allows message body to be written to a file. (Mike) - Fixed imagecolorallocate() and imagecolorallocatelapha() to return FALSE on error. (Pierre) +- Fixed bug #36258 (SplFileObject::getPath() may lead to segfault). (Tony) - Fixed bug #36242 (Possible memory corruption in stream_select()). (Tony) - Fixed bug #36235 (ocicolumnname returns false before a succesfull fetch). (Tony) diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 249f427006..3436452acf 100755 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -340,6 +340,8 @@ static spl_filesystem_object * spl_filesystem_object_create_type(int ht, spl_fil spl_filesystem_object_get_file_name(source TSRMLS_CC); intern->file_name = estrndup(source->file_name, source->file_name_len); intern->file_name_len = source->file_name_len; + intern->path = estrndup(source->path, source->path_len); + intern->path_len = source->path_len; break; case SPL_FS_FILE: return_value->value.obj = spl_filesystem_object_new_ex(ce ? ce : source->file_class, &intern TSRMLS_CC);