From: Ilia Alshanetsky Date: Tue, 27 Sep 2005 15:07:38 +0000 (+0000) Subject: Fixed bug #32937 (open_basedir looses trailing / in the limiter). X-Git-Tag: RELEASE_0_9_0~91 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d2e7a84caa611ff547b5da98d30b978933f751d;p=php Fixed bug #32937 (open_basedir looses trailing / in the limiter). Patch by Adam Conrad --- diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index af28b8f758..ad9eecf790 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -108,8 +108,8 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path /* Handler for basedirs that end with a / */ resolved_basedir_len = strlen(resolved_basedir); if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR) { - if (resolved_basedir[resolved_basedir_len - 1] == '/') { - resolved_basedir[resolved_basedir_len - 1] = PHP_DIR_SEPARATOR; + if (resolved_basedir[resolved_basedir_len - 1] != PHP_DIR_SEPARATOR) { + resolved_basedir[resolved_basedir_len] = PHP_DIR_SEPARATOR; resolved_basedir[++resolved_basedir_len] = '\0'; } }