]> granicus.if.org Git - php/commitdiff
Fixed bug #32937 (open_basedir looses trailing / in the limiter).
authorIlia Alshanetsky <iliaa@php.net>
Tue, 27 Sep 2005 15:07:38 +0000 (15:07 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 27 Sep 2005 15:07:38 +0000 (15:07 +0000)
Patch by Adam Conrad

main/fopen_wrappers.c

index af28b8f758bd3007d218648ea1cc1e33b914d4ff..ad9eecf790a6b495b0f68d72ea9fdbff9889f4ca 100644 (file)
@@ -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';
                        }
                }