iliaa Wed Jun 24 12:21:21 2009 UTC Modified files: (Branch: PHP_5_2) /php-src NEWS /php-src/main php_open_temporary_file.c Log: Fixed bug #48465 (sys_get_temp_dir() possibly inconsistent when using TMPDIR). http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1568&r2=1.2027.2.547.2.1569&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.1568 php-src/NEWS:1.2027.2.547.2.1569 --- php-src/NEWS:1.2027.2.547.2.1568 Wed Jun 24 07:43:18 2009 +++ php-src/NEWS Wed Jun 24 12:21:19 2009 @@ -9,6 +9,8 @@ - Fixed bug #48619 (imap_search ALL segfaults). (Pierre) - Fixed bug #48555 (ImageFTBBox() differs from previous versions for texts with new lines) (Takeshi Abe) +- Fixed bug #48465 (sys_get_temp_dir() possibly inconsistent when using + TMPDIR). (Ilia) - Fixed bug #48450 (Compile failure under IRIX 6.5.30 building gd.c). (Kalle) - Fixed bug #48276 (date("Y") on big endian machines produces the wrong result). (Scott) http://cvs.php.net/viewvc.cgi/php-src/main/php_open_temporary_file.c?r1=1.34.2.1.2.12&r2=1.34.2.1.2.13&diff_format=u Index: php-src/main/php_open_temporary_file.c diff -u php-src/main/php_open_temporary_file.c:1.34.2.1.2.12 php-src/main/php_open_temporary_file.c:1.34.2.1.2.13 --- php-src/main/php_open_temporary_file.c:1.34.2.1.2.12 Wed Dec 31 11:17:47 2008 +++ php-src/main/php_open_temporary_file.c Wed Jun 24 12:21:20 2009 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_open_temporary_file.c,v 1.34.2.1.2.12 2008/12/31 11:17:47 sebastian Exp $ */ +/* $Id: php_open_temporary_file.c,v 1.34.2.1.2.13 2009/06/24 12:21:20 iliaa Exp $ */ #include "php.h" @@ -200,7 +200,14 @@ { char* s = getenv("TMPDIR"); if (s) { - temporary_directory = strdup(s); + int len = strlen(s); + + if (s[len - 1] == DEFAULT_SLASH) { + temporary_directory = zend_strndup(s, len - 1); + } else { + temporary_directory = zend_strndup(s, len); + } + return temporary_directory; } }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php