From 281fb1f2ed92147f8aa1638cfdabbb95fc0f371c Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 28 Nov 2008 11:56:50 +0000 Subject: [PATCH] Fixed bug #46366 (bad cwd with / as pathinfo) --- NEWS | 1 + sapi/cgi/cgi_main.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 3513d2f3bd..fb51c800ee 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? Dec 2008, PHP 5.2.7 +- Fixed bug #46366 (bad cwd with / as pathinfo). (Dmitry) 27 Nov 2008, PHP 5.2.7RC5 - Upgraded PCRE to version 7.8 (Fixes CVE-2008-2371) (Ilia) diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 3fb5e37dda..2d828acb72 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -985,6 +985,9 @@ static void init_request_info(TSRMLS_D) if (script_path_translated && (script_path_translated_len = strlen(script_path_translated)) > 0 && (script_path_translated[script_path_translated_len-1] == '/' || +#ifdef PHP_WIN32 + script_path_translated[script_path_translated_len-1] == '\\' || +#endif (real_path = tsrm_realpath(script_path_translated, NULL TSRMLS_CC)) == NULL)) { char *pt = estrndup(script_path_translated, script_path_translated_len); int len = script_path_translated_len; -- 2.50.1