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

main/streams/plain_wrapper.c

index c75859f4cd59c2d86e8aef94e3a6c0f1f827dc79..a8611973cb5fc17c6e1b9f8c107c8a1087387adb 100644 (file)
@@ -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 */