]> granicus.if.org Git - php/commitdiff
@- Fixed a possible crash in the PHP CGI when no input file is
authorZeev Suraski <zeev@php.net>
Thu, 10 May 2001 14:13:18 +0000 (14:13 +0000)
committerZeev Suraski <zeev@php.net>
Thu, 10 May 2001 14:13:18 +0000 (14:13 +0000)
@  specified (Zeev)
Fixed bug 7822

sapi/cgi/cgi_main.c

index c2cb43b212f29dea80d3cd518ab00f812abeaa79..dc1cfe9191270cd0316d65ae40a5f26b408324b7 100644 (file)
@@ -692,8 +692,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine
        }
 
        if (cgi && !file_handle.handle.fp) {
-               file_handle.handle.fp = VCWD_FOPEN(argv0, "rb");
-               if(!file_handle.handle.fp) {
+               if(!argv0 || !(file_handle.handle.fp = VCWD_FOPEN(argv0, "rb"))) {
                        PUTS("No input file specified.\n");
                        php_request_shutdown((void *) 0);
                        php_module_shutdown();