pajoye Mon, 28 Mar 2011 16:43:49 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=309792
Log: - Fixed bug #48465 (sys_get_temp_dir() possibly inconsistent, windows fix Bug: http://bugs.php.net/48465 (Assigned) sys_get_temp_dir() possibly inconsistent when using TMPDIR Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/main/php_open_temporary_file.c U php/php-src/trunk/main/php_open_temporary_file.c Modified: php/php-src/branches/PHP_5_3/NEWS =================================================================== --- php/php-src/branches/PHP_5_3/NEWS 2011-03-28 16:34:07 UTC (rev 309791) +++ php/php-src/branches/PHP_5_3/NEWS 2011-03-28 16:43:49 UTC (rev 309792) @@ -6,10 +6,16 @@ (Dmitry) - Core: + . Fixed a crash inside dtor for error handling. (Ilia) . Fixed bug #54180 (parse_url() incorrectly parses path when ? in fragment). (tomas dot brastavicius at quantum dot lt, Pierrick) - . Fixed a crash inside dtor for error handling. (Ilia) + . Fixed bug #48465 (sys_get_temp_dir() possibly inconsistent when using + TMPDIR on Windows). (Pierre) +- cURL extension: + . Add curl.cainfo ini option to set the path to a defailt CA bundle file, used + by CURLOPT_CAINFO option. (Pierre) + - DateTime extension: . Fixed bug #54340 (DateTime::add() method bug). (Adam) . Fixed bug #54316 (DateTime::createFromFormat does not handle trailing '|' Modified: php/php-src/branches/PHP_5_3/main/php_open_temporary_file.c =================================================================== --- php/php-src/branches/PHP_5_3/main/php_open_temporary_file.c 2011-03-28 16:34:07 UTC (rev 309791) +++ php/php-src/branches/PHP_5_3/main/php_open_temporary_file.c 2011-03-28 16:43:49 UTC (rev 309792) @@ -204,9 +204,13 @@ */ { char sTemp[MAX_PATH]; - DWORD n = GetTempPath(sizeof(sTemp),sTemp); - assert(0 < n); /* should *never* fail! */ - temporary_directory = strdup(sTemp); + DWORD len = GetTempPath(sizeof(sTemp),sTemp); + assert(0 < len); /* should *never* fail! */ + if (sTemp[len - 1] == DEFAULT_SLASH) { + temporary_directory = zend_strndup(sTemp, len - 1); + } else { + temporary_directory = zend_strndup(sTemp, len); + } return temporary_directory; } #else Modified: php/php-src/trunk/main/php_open_temporary_file.c =================================================================== --- php/php-src/trunk/main/php_open_temporary_file.c 2011-03-28 16:34:07 UTC (rev 309791) +++ php/php-src/trunk/main/php_open_temporary_file.c 2011-03-28 16:43:49 UTC (rev 309792) @@ -204,9 +204,13 @@ */ { char sTemp[MAX_PATH]; - DWORD n = GetTempPath(sizeof(sTemp),sTemp); - assert(0 < n); /* should *never* fail! */ - temporary_directory = strdup(sTemp); + DWORD len = GetTempPath(sizeof(sTemp),sTemp); + assert(0 < len); /* should *never* fail! */ + if (sTemp[len - 1] == DEFAULT_SLASH) { + temporary_directory = zend_strndup(sTemp, len - 1); + } else { + temporary_directory = zend_strndup(sTemp, len); + } return temporary_directory; } #else
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php