summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-09-12 15:47:25 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-09-12 15:47:25 +0000
commitf0fd70fadb75cf0da2bdfb480045a830a200a15f (patch)
tree2d7930a77a3bab7ddba8fc7877681fb8908f794b
parentbb2d53e768edf7f68adfce4615ff2871e9aa0e80 (diff)
downloadphp-git-f0fd70fadb75cf0da2bdfb480045a830a200a15f.tar.gz
Fixed bug #37779 (empty include_path leads to search for files inside /).
-rw-r--r--NEWS2
-rw-r--r--main/streams/plain_wrapper.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 0a4cb5c958..53d4916cf1 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,8 @@
- Fixed bug #38096 (large timeout values ignored on 32bit machines in
stream_socket_accept() and stream_socket_client()). (Ilia)
- Fixed bug #37923 (Display constant value in reflection::export). (Johannes)
+- Fixed bug #37779 (empty include_path leads to search for files inside /).
+ (jr at terragate dot net, Ilia)
31 Aug 2006, PHP 5.2.0RC3
- Updated PCRE to version 6.7. (Ilia)
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index e9126de4eb..0fa946ebfc 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -1310,11 +1310,13 @@ not_relative_path:
*end = '\0';
end++;
}
+ if (*ptr == '\0') {
+ goto stream_skip;
+ }
snprintf(trypath, MAXPATHLEN, "%s/%s", ptr, filename);
if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir_ex(trypath, 0 TSRMLS_CC)) {
- ptr = end;
- continue;
+ goto stream_skip;
}
if (PG(safe_mode)) {
@@ -1327,8 +1329,7 @@ not_relative_path:
goto stream_done;
}
}
- ptr = end;
- continue;
+ goto stream_skip;
}
stream = php_stream_fopen_rel(trypath, mode, opened_path, options);
if (stream) {
@@ -1336,6 +1337,7 @@ stream_done:
efree(pathbuf);
return stream;
}
+stream_skip:
ptr = end;
} /* end provided path */