]> granicus.if.org Git - php/commitdiff
prevent possible crash if used in combo with mod_gzip
authorShane Caraveo <shane@php.net>
Mon, 17 Feb 2003 03:39:58 +0000 (03:39 +0000)
committerShane Caraveo <shane@php.net>
Mon, 17 Feb 2003 03:39:58 +0000 (03:39 +0000)
fix command line

sapi/cgi/cgi_main.c

index 207d8e2949aba0522708f77fe12ca890a156d39f..a4a8dcbc5a9a9bb3e91b9eb55561f46602eb7350 100644 (file)
@@ -715,7 +715,7 @@ static void init_request_info(TSRMLS_D)
                         * of it by stat'ing back through the '/'
                         * this fixes url's like /info.php/test
                         */
-                       if (stat( script_path_translated, &st ) == -1 ) {
+                       if (script_path_translated && stat( script_path_translated, &st ) == -1 ) {
                                char *pt = estrdup(script_path_translated);
                                int len = strlen(pt);
                                char *ptr;
@@ -1456,7 +1456,7 @@ consult the installation file that came with this distribution, or visit \n\
                        if we are unable to open path_translated and we are not
                        running from shell (so fp == NULL), then fail.
                */
-               if (retval == FAILURE || file_handle.handle.fp == NULL) {
+               if (retval == FAILURE && file_handle.handle.fp == NULL) {
                        SG(sapi_headers).http_response_code = 404;
                        PUTS("No input file specified.\n");
                        php_request_shutdown((void *) 0);