fat                                      Tue, 03 Jan 2012 22:26:11 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=321734

Log:
- Fixed bug #60629 (memory corruption when web server closed the fcgi fd)

Bug: https://bugs.php.net/60629 (Feedback) memory corruption when web server 
closed the fcgi fd(?)
      
Changed paths:
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fastcgi.c
    U   php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fastcgi.h
    U   php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_main.c
    U   php/php-src/branches/PHP_5_4/NEWS
    U   php/php-src/branches/PHP_5_4/sapi/fpm/fpm/fastcgi.c
    U   php/php-src/branches/PHP_5_4/sapi/fpm/fpm/fastcgi.h
    U   php/php-src/branches/PHP_5_4/sapi/fpm/fpm/fpm_main.c
    U   php/php-src/trunk/sapi/fpm/fpm/fastcgi.c
    U   php/php-src/trunk/sapi/fpm/fpm/fastcgi.h
    U   php/php-src/trunk/sapi/fpm/fpm/fpm_main.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS   2012-01-03 21:47:16 UTC (rev 321733)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-01-03 22:26:11 UTC (rev 321734)
@@ -19,7 +19,11 @@
   . Fixed bug #48877 ("bindValue" and "bindParam" do not work for PDO 
Firebird).
     (Mariuz)

+- PHP-FPM SAPI:
+  . Fixed bug #60629 (memory corruption when web server closed the fcgi fd).
+    (fat)

+
 08 Dec 2011, PHP 5.3.9RC3

 - Filter:

Modified: php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fastcgi.c
===================================================================
--- php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fastcgi.c 2012-01-03 21:47:16 UTC 
(rev 321733)
+++ php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fastcgi.c 2012-01-03 22:26:11 UTC 
(rev 321734)
@@ -946,7 +946,7 @@
        return 1;
 }

-int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int 
len)
+ssize_t fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, 
int len)
 {
        int limit, rest;


Modified: php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fastcgi.h
===================================================================
--- php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fastcgi.h 2012-01-03 21:47:16 UTC 
(rev 321733)
+++ php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fastcgi.h 2012-01-03 22:26:11 UTC 
(rev 321734)
@@ -127,7 +127,7 @@

 int fcgi_read(fcgi_request *req, char *str, int len);

-int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int 
len);
+ssize_t fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, 
int len);
 int fcgi_flush(fcgi_request *req, int close);

 void fcgi_set_mgmt_var(const char * name, size_t name_len, const char * value, 
size_t value_len);

Modified: php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_main.c
===================================================================
--- php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_main.c        2012-01-03 
21:47:16 UTC (rev 321733)
+++ php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_main.c        2012-01-03 
22:26:11 UTC (rev 321734)
@@ -268,7 +268,7 @@

 static inline size_t sapi_cgibin_single_write(const char *str, uint str_length 
TSRMLS_DC)
 {
-       size_t ret;
+       ssize_t ret;

        /* sapi has started which means everyhting must be send through fcgi */
        if (fpm_is_running) {
@@ -277,7 +277,7 @@
                if (ret <= 0) {
                        return 0;
                }
-               return ret;
+               return (size_t)ret;
        }

        /* sapi has not started, output to stdout instead of fcgi */
@@ -286,7 +286,7 @@
        if (ret <= 0) {
                return 0;
        }
-       return ret;
+       return (size_t)ret;
 #else
        return fwrite(str, 1, MIN(str_length, 16384), stdout);
 #endif

Modified: php/php-src/branches/PHP_5_4/NEWS
===================================================================
--- php/php-src/branches/PHP_5_4/NEWS   2012-01-03 21:47:16 UTC (rev 321733)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-01-03 22:26:11 UTC (rev 321734)
@@ -18,7 +18,11 @@
 - Intl:
   . Fixed build on Fedora 15 / Ubuntu 11. (Hannes)

+- PHP-FPM SAPI:
+  . Fixed bug #60629 (memory corruption when web server closed the fcgi fd).
+    (fat)

+
 22 Dec 2011, PHP 5.4.0 RC4
 - Core:
   . Added max_input_vars directive to prevent attacks based on hash collisions

Modified: php/php-src/branches/PHP_5_4/sapi/fpm/fpm/fastcgi.c
===================================================================
--- php/php-src/branches/PHP_5_4/sapi/fpm/fpm/fastcgi.c 2012-01-03 21:47:16 UTC 
(rev 321733)
+++ php/php-src/branches/PHP_5_4/sapi/fpm/fpm/fastcgi.c 2012-01-03 22:26:11 UTC 
(rev 321734)
@@ -946,7 +946,7 @@
        return 1;
 }

-int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int 
len)
+ssize_t fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, 
int len)
 {
        int limit, rest;


Modified: php/php-src/branches/PHP_5_4/sapi/fpm/fpm/fastcgi.h
===================================================================
--- php/php-src/branches/PHP_5_4/sapi/fpm/fpm/fastcgi.h 2012-01-03 21:47:16 UTC 
(rev 321733)
+++ php/php-src/branches/PHP_5_4/sapi/fpm/fpm/fastcgi.h 2012-01-03 22:26:11 UTC 
(rev 321734)
@@ -127,7 +127,7 @@

 int fcgi_read(fcgi_request *req, char *str, int len);

-int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int 
len);
+ssize_t fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, 
int len);
 int fcgi_flush(fcgi_request *req, int close);

 void fcgi_set_mgmt_var(const char * name, size_t name_len, const char * value, 
size_t value_len);

Modified: php/php-src/branches/PHP_5_4/sapi/fpm/fpm/fpm_main.c
===================================================================
--- php/php-src/branches/PHP_5_4/sapi/fpm/fpm/fpm_main.c        2012-01-03 
21:47:16 UTC (rev 321733)
+++ php/php-src/branches/PHP_5_4/sapi/fpm/fpm/fpm_main.c        2012-01-03 
22:26:11 UTC (rev 321734)
@@ -268,7 +268,7 @@

 static inline size_t sapi_cgibin_single_write(const char *str, uint str_length 
TSRMLS_DC)
 {
-       size_t ret;
+       ssize_t ret;

        /* sapi has started which means everyhting must be send through fcgi */
        if (fpm_is_running) {
@@ -277,7 +277,7 @@
                if (ret <= 0) {
                        return 0;
                }
-               return ret;
+               return (size_t)ret;
        }

        /* sapi has not started, output to stdout instead of fcgi */
@@ -286,7 +286,7 @@
        if (ret <= 0) {
                return 0;
        }
-       return ret;
+       return (size_t)ret;
 #else
        return fwrite(str, 1, MIN(str_length, 16384), stdout);
 #endif

Modified: php/php-src/trunk/sapi/fpm/fpm/fastcgi.c
===================================================================
--- php/php-src/trunk/sapi/fpm/fpm/fastcgi.c    2012-01-03 21:47:16 UTC (rev 
321733)
+++ php/php-src/trunk/sapi/fpm/fpm/fastcgi.c    2012-01-03 22:26:11 UTC (rev 
321734)
@@ -946,7 +946,7 @@
        return 1;
 }

-int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int 
len)
+ssize_t fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, 
int len)
 {
        int limit, rest;


Modified: php/php-src/trunk/sapi/fpm/fpm/fastcgi.h
===================================================================
--- php/php-src/trunk/sapi/fpm/fpm/fastcgi.h    2012-01-03 21:47:16 UTC (rev 
321733)
+++ php/php-src/trunk/sapi/fpm/fpm/fastcgi.h    2012-01-03 22:26:11 UTC (rev 
321734)
@@ -127,7 +127,7 @@

 int fcgi_read(fcgi_request *req, char *str, int len);

-int fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, int 
len);
+ssize_t fcgi_write(fcgi_request *req, fcgi_request_type type, const char *str, 
int len);
 int fcgi_flush(fcgi_request *req, int close);

 void fcgi_set_mgmt_var(const char * name, size_t name_len, const char * value, 
size_t value_len);

Modified: php/php-src/trunk/sapi/fpm/fpm/fpm_main.c
===================================================================
--- php/php-src/trunk/sapi/fpm/fpm/fpm_main.c   2012-01-03 21:47:16 UTC (rev 
321733)
+++ php/php-src/trunk/sapi/fpm/fpm/fpm_main.c   2012-01-03 22:26:11 UTC (rev 
321734)
@@ -268,7 +268,7 @@

 static inline size_t sapi_cgibin_single_write(const char *str, uint str_length 
TSRMLS_DC)
 {
-       size_t ret;
+       ssize_t ret;

        /* sapi has started which means everyhting must be send through fcgi */
        if (fpm_is_running) {
@@ -277,7 +277,7 @@
                if (ret <= 0) {
                        return 0;
                }
-               return ret;
+               return (size_t)ret;
        }

        /* sapi has not started, output to stdout instead of fcgi */
@@ -286,7 +286,7 @@
        if (ret <= 0) {
                return 0;
        }
-       return ret;
+       return (size_t)ret;
 #else
        return fwrite(str, 1, MIN(str_length, 16384), stdout);
 #endif

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to