]> granicus.if.org Git - php/commitdiff
Fixed bug #37779 (empty include_path leads to search for files inside /).
authorIlia Alshanetsky <iliaa@php.net>
Tue, 12 Sep 2006 15:47:25 +0000 (15:47 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 12 Sep 2006 15:47:25 +0000 (15:47 +0000)
NEWS
main/streams/plain_wrapper.c

diff --git a/NEWS b/NEWS
index 0a4cb5c958bba5800d1ccc5798c49c46ff869581..53d4916cf1067adbfb1e18c24459772436eb5331 100644 (file)
--- 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)
index e9126de4eb62357927c36bee19d55141ff5879c9..0fa946ebfca3288ce4c82fb0791fe0713887ba58 100644 (file)
@@ -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 */