diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c index 64fc165174051..6bff2ad984d02 100644 --- a/Zend/zend_virtual_cwd.c +++ b/Zend/zend_virtual_cwd.c @@ -1009,7 +1009,7 @@ static size_t tsrm_realpath_r(char *path, size_t start, size_t len, int *ll, tim CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath) /* {{{ */ { size_t path_length = strlen(path); - char resolved_path[MAXPATHLEN] = {0}; + char resolved_path[MAXPATHLEN]; size_t start = 1; int ll = 0; time_t t; @@ -1131,6 +1131,9 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func /* skip DRIVE name */ resolved_path[0] = toupper(resolved_path[0]); resolved_path[2] = DEFAULT_SLASH; + if (path_length == 2) { + resolved_path[3] = '\0'; + } start = 3; } #endif