From: Ilia Alshanetsky Date: Tue, 12 Sep 2006 15:47:25 +0000 (+0000) Subject: Fixed bug #37779 (empty include_path leads to search for files inside /). X-Git-Tag: php-5.2.0RC4~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f0fd70fadb75cf0da2bdfb480045a830a200a15f;p=php Fixed bug #37779 (empty include_path leads to search for files inside /). --- 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 */