summaryrefslogtreecommitdiff
path: root/main/streams/plain_wrapper.c
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 /main/streams/plain_wrapper.c
parentbb2d53e768edf7f68adfce4615ff2871e9aa0e80 (diff)
downloadphp-git-f0fd70fadb75cf0da2bdfb480045a830a200a15f.tar.gz
Fixed bug #37779 (empty include_path leads to search for files inside /).
Diffstat (limited to 'main/streams/plain_wrapper.c')
-rw-r--r--main/streams/plain_wrapper.c10
1 files changed, 6 insertions, 4 deletions
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 */