com php-src: Fixed bug #70538 ("php-fpm -i" crashes): NEWS sapi/fpm/fpm/fpm_main.c
| From: | Xinchen Hui | Date: | Mon, 21 Sep 2015 03:18:37 +0000 |
| Subject: | com php-src: Fixed bug #70538 ("php-fpm -i" crashes): NEWS sapi/fpm/fpm/fpm_main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89095@lists.php.net to get a copy of this message | ||
Commit: 85eece9c4fab08cc73f09f5bb67c3a2752b746b2
Author: Xinchen Hui <laruence@gmail.com> Mon, 21 Sep 2015 11:18:37 +0800
Parents: a247c3a27df89a9839c8d87d66173f4f59873d3a
Branches: PHP-7.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=85eece9c4fab08cc73f09f5bb67c3a2752b746b2
Log:
Fixed bug #70538 ("php-fpm -i" crashes)
Bugs:
https://bugs.php.net/70538
Changed paths:
M NEWS
M sapi/fpm/fpm/fpm_main.c
Diff:
diff --git a/NEWS b/NEWS
index b62d856..3d8abc9 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,10 @@ PHP NEWS
. Fixed bug #70481 (Memory leak in auto_global_copy_ctor() in ZTS build).
(Laruence)
+- FPM:
+ . Fixed bug #70538 ("php-fpm -i" crashes). (rainer dot jung at
+ kippdata dot de)
+
- OpenSSL
. Require at least OpenSSL version 0.9.8. (Jakub Zelenka)
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 18f8a90..ca478b3 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -589,7 +589,6 @@ void cgi_php_import_environment_variables(zval *array_ptr) /* {{{ */
static void sapi_cgi_register_variables(zval *track_vars_array) /* {{{ */
{
- fcgi_request *request = (fcgi_request*) SG(server_context);
size_t php_self_len;
char *php_self;
@@ -601,7 +600,7 @@ static void sapi_cgi_register_variables(zval *track_vars_array) /* {{{ */
if (CGIG(fix_pathinfo)) {
char *script_name = SG(request_info).request_uri;
unsigned int script_name_len = script_name ? strlen(script_name) : 0;
- char *path_info = request? FCGI_GETENV(request, "PATH_INFO") : NULL;
+ char *path_info = sapi_cgibin_getenv("PATH_INFO", sizeof("PATH_INFO") - 1);
unsigned int path_info_len = path_info ? strlen(path_info) : 0;
php_self_len = script_name_len + path_info_len;