iliaa Wed Jun 24 12:21:37 2009 UTC Modified files: /php-src/main php_open_temporary_file.c Log: MFB: Fixed bug #48465 (sys_get_temp_dir() possibly inconsistent when using TMPDIR). http://cvs.php.net/viewvc.cgi/php-src/main/php_open_temporary_file.c?r1=1.47&r2=1.48&diff_format=u Index: php-src/main/php_open_temporary_file.c diff -u php-src/main/php_open_temporary_file.c:1.47 php-src/main/php_open_temporary_file.c:1.48 --- php-src/main/php_open_temporary_file.c:1.47 Tue Mar 10 23:39:53 2009 +++ php-src/main/php_open_temporary_file.c Wed Jun 24 12:21:37 2009 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_open_temporary_file.c,v 1.47 2009/03/10 23:39:53 helly Exp $ */ +/* $Id: php_open_temporary_file.c,v 1.48 2009/06/24 12:21:37 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