cvs: TSRM / tsrm_config_common.h tsrm_virtual_cwd.c
| From: | Ilia Alshanetsky | Date: | Tue, 20 Dec 2005 14:26:55 +0000 |
| Subject: | cvs: TSRM / tsrm_config_common.h tsrm_virtual_cwd.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4467@lists.php.net to get a copy of this message | ||
iliaa Tue Dec 20 14:26:55 2005 EDT
Modified files:
/TSRM tsrm_config_common.h tsrm_virtual_cwd.c
Log:
MFB51: Fixed bug #31347 (is_dir and is_file (incorrectly) return true for any
string greater then 255 characters).
http://cvs.php.net/viewcvs.cgi/TSRM/tsrm_config_common.h?r1=1.17&r2=1.18&diff_format=u
Index: TSRM/tsrm_config_common.h
diff -u TSRM/tsrm_config_common.h:1.17 TSRM/tsrm_config_common.h:1.18
--- TSRM/tsrm_config_common.h:1.17 Thu Mar 17 08:15:22 2005
+++ TSRM/tsrm_config_common.h Tue Dec 20 14:26:55 2005
@@ -42,6 +42,8 @@
#ifndef MAXPATHLEN
# ifdef PATH_MAX
# define MAXPATHLEN PATH_MAX
+# elif defined(MAX_PATH)
+# define MAXPATHLEN MAX_PATH
# else
# define MAXPATHLEN 256
# endif
http://cvs.php.net/viewcvs.cgi/TSRM/tsrm_virtual_cwd.c?r1=1.74&r2=1.75&diff_format=u
Index: TSRM/tsrm_virtual_cwd.c
diff -u TSRM/tsrm_virtual_cwd.c:1.74 TSRM/tsrm_virtual_cwd.c:1.75
--- TSRM/tsrm_virtual_cwd.c:1.74 Wed Aug 3 13:28:14 2005
+++ TSRM/tsrm_virtual_cwd.c Tue Dec 20 14:26:55 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: tsrm_virtual_cwd.c,v 1.74 2005/08/03 13:28:14 sniper Exp $ */
+/* $Id: tsrm_virtual_cwd.c,v 1.75 2005/12/20 14:26:55 iliaa Exp $ */
#include <sys/types.h>
#include <sys/stat.h>
@@ -478,13 +478,14 @@
#endif
#if defined(TSRM_WIN32)
{
- char *dummy = NULL;
int new_path_length;
- new_path_length = GetLongPathName(path, dummy, 0) + 1;
+ new_path_length = GetLongPathName(path, NULL, 0);
if (new_path_length == 0) {
return 1;
}
+
+ /* GetLongPathName already counts the \0 */
new_path = (char *) malloc(new_path_length);
if (!new_path) {
return 1;
@@ -856,7 +857,9 @@
int retval;
CWD_STATE_COPY(&new_state, &CWDG(cwd));
- virtual_file_ex(&new_state, path, NULL, 1);
+ if (virtual_file_ex(&new_state, path, NULL, 1)) {
+ return -1;
+ }
retval = stat(new_state.cwd, buf);