From: Ilia Alshanetsky Date: Tue, 12 Sep 2006 15:49:02 +0000 (+0000) Subject: MFB: Fixed bug #37779 (empty include_path leads to search for files X-Git-Tag: RELEASE_1_0_0RC1~1691 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=504078c64e908a3f03721162cca1baaa9c5f1d84;p=php MFB: Fixed bug #37779 (empty include_path leads to search for files inside /). --- diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index c75859f4cd..a8611973cb 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -1262,11 +1262,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; } stream = php_stream_fopen_rel(trypath, mode, opened_path, options); @@ -1275,6 +1277,7 @@ stream_done: efree(pathbuf); return stream; } +stream_skip: ptr = end; } /* end provided path */