From: Shane Caraveo Date: Mon, 17 Feb 2003 03:39:58 +0000 (+0000) Subject: prevent possible crash if used in combo with mod_gzip X-Git-Tag: RELEASE_0_5~952 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c73b6ab702f72b494615e079ddf96ec0dfe1413;p=php prevent possible crash if used in combo with mod_gzip fix command line --- diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 207d8e2949..a4a8dcbc5a 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -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);