]> granicus.if.org Git - php/commitdiff
- Fixed bug #48465 (sys_get_temp_dir() possibly inconsistent, windows fix
authorPierre Joye <pajoye@php.net>
Mon, 28 Mar 2011 16:43:49 +0000 (16:43 +0000)
committerPierre Joye <pajoye@php.net>
Mon, 28 Mar 2011 16:43:49 +0000 (16:43 +0000)
NEWS
main/php_open_temporary_file.c

diff --git a/NEWS b/NEWS
index fffb954dade3d7cf44b9dfe59019ff732c80a1e0..729245817798208b9f95b1217c56b830d287db27 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,9 +6,15 @@ PHP                                                                        NEWS
     (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)
index 00a0f3f446a8c199ca8fa7c8d815e1fd64f71569..0ab82c7864096dec1c70f25c0e9b1c12ad6da5fd 100644 (file)
@@ -204,9 +204,13 @@ PHPAPI const char* php_get_temporary_directory(void)
         */
        {
                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