From 1f454695a4494d9e94a2ff8d9e4152a62c46c4b7 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Tue, 23 Nov 2010 22:14:54 +0000 Subject: [PATCH] - fixed #53352 --- main/fopen_wrappers.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 5424f78970..53981059d1 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -233,6 +233,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); @@ -250,7 +253,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 */ -- 2.40.0