cvs: php4 /sapi/cgi cgi_main.c
| From: | Stanislav Malyshev | Date: | Sat, 05 Aug 2000 11:28:32 +0000 |
| Subject: | cvs: php4 /sapi/cgi cgi_main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1048@lists.php.net to get a copy of this message | ||
stas Sat Aug 5 04:28:32 2000 EDT
Modified files:
/php4/sapi/cgi cgi_main.c
Log:
Fix crash on broken setups (#5979)
Index: php4/sapi/cgi/cgi_main.c
diff -u php4/sapi/cgi/cgi_main.c:1.65 php4/sapi/cgi/cgi_main.c:1.66
--- php4/sapi/cgi/cgi_main.c:1.65 Wed Aug 2 15:48:43 2000
+++ php4/sapi/cgi/cgi_main.c Sat Aug 5 04:28:32 2000
@@ -669,11 +669,15 @@
or user_dir configuration directives, PATH_INFO is used to construct
the filename as a side effect of php_fopen_primary_script.
*/
+ char *env_path_translated=NULL;
#if DISCARD_PATH
- SG(request_info).path_translated = estrdup(getenv("SCRIPT_FILENAME"));
+ env_path_translated = getenv("SCRIPT_FILENAME");
#else
- SG(request_info).path_translated = estrdup(getenv("PATH_TRANSLATED"));
+ env_path_translated = getenv("PATH_TRANSLATED");
#endif
+ if(env_path_translated) {
+ SG(request_info).path_translated = estrdup(env_path_translated);
+ }
}
if (cgi || SG(request_info).path_translated) {
file_handle.handle.fp = php_fopen_primary_script();