php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #53516
Patch open_basedir-5.2.15-fix.patch revision 2010-12-10 10:44 UTC by ofi at evil dot net dot pl

Patch open_basedir-5.2.15-fix.patch for Streams related Bug #53516

Patch version 2010-12-10 10:44 UTC

Return to Bug #53516 | Download this patch
Patch Revisions:

Developer: ofi@evil.net.pl

diff -ruN php-5.2.15/main/fopen_wrappers.c php-5.2.15.ofi/main/fopen_wrappers.c
--- php-5.2.15/main/fopen_wrappers.c	2010-12-09 18:04:29.000000000 +0100
+++ php-5.2.15.ofi/main/fopen_wrappers.c	2010-12-10 11:32:02.000000000 +0100
@@ -192,7 +192,7 @@
 		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 */
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 08:02:33 2014 UTC