From: Pierre Joye Date: Tue, 23 Nov 2010 22:14:54 +0000 (+0000) Subject: - fixed #53352 X-Git-Tag: php-5.3.4RC2~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2ba369cdfae077c3607d600412cac80620f4b042;p=php - fixed #53352 --- diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 303ff55525..dc3bc8e4e2 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -234,6 +234,9 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path resolved_basedir[resolved_basedir_len] = PHP_DIR_SEPARATOR; resolved_basedir[++resolved_basedir_len] = '\0'; } + } else { + resolved_basedir[resolved_basedir_len++] = PHP_DIR_SEPARATOR; + resolved_basedir[resolved_basedir_len] = '\0'; } resolved_name_len = strlen(resolved_name); @@ -251,7 +254,7 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path if (strncmp(resolved_basedir, resolved_name, resolved_basedir_len) == 0) { #endif if (resolved_name_len > resolved_basedir_len && - resolved_name[resolved_basedir_len] != PHP_DIR_SEPARATOR) { + resolved_name[resolved_basedir_len - 1] != PHP_DIR_SEPARATOR) { return -1; } else { /* File is in the right directory */