shane Sun Feb 16 22:39:58 2003 EDT Modified files: /php4/sapi/cgi cgi_main.c Log: prevent possible crash if used in combo with mod_gzip fix command line Index: php4/sapi/cgi/cgi_main.c diff -u php4/sapi/cgi/cgi_main.c:1.212 php4/sapi/cgi/cgi_main.c:1.213 --- php4/sapi/cgi/cgi_main.c:1.212 Sat Feb 15 20:23:11 2003 +++ php4/sapi/cgi/cgi_main.c Sun Feb 16 22:39:58 2003 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cgi_main.c,v 1.212 2003/02/16 01:23:11 helly Exp $ */ +/* $Id: cgi_main.c,v 1.213 2003/02/17 03:39:58 shane Exp $ */ #include "php.h" #include "php_globals.h" @@ -715,7 +715,7 @@ * 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 @@ 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);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php