]> granicus.if.org Git - php/commitdiff
- Fixed bug #60629 (memory corruption when web server closed the fcgi fd)
authorJérôme Loyet <fat@php.net>
Tue, 3 Jan 2012 22:26:11 +0000 (22:26 +0000)
committerJérôme Loyet <fat@php.net>
Tue, 3 Jan 2012 22:26:11 +0000 (22:26 +0000)
NEWS
sapi/fpm/fpm/fastcgi.c
sapi/fpm/fpm/fastcgi.h
sapi/fpm/fpm/fpm_main.c

diff --git a/NEWS b/NEWS
index dac5b30042c43513f90db29bd889e2583d6bb380..ed32ed3caf3ff65f415adc746668edc13ec7df88 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,10 @@ PHP                                                                        NEWS
   . 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
 
index b8d10a538d8d1813e17c7fee38124313f1831ba1..212b6ff1db5221e7540f23f4c58ed02deae9822a 100644 (file)
@@ -946,7 +946,7 @@ int fcgi_flush(fcgi_request *req, int close)
        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;
 
index caac528547756353a7eea17c01c7b64ecdfa357f..7a9f3ef363d70749533d662c3a806e8fb8c72c29 100644 (file)
@@ -127,7 +127,7 @@ char* fcgi_putenv(fcgi_request *req, char* var, int var_len, char* val);
 
 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);
index 1d3488a1b80a33491938161bd8380380f98b9b10..ea0dd149f7da1b9dd8ec183f6727fef850da9e2d 100644 (file)
@@ -268,7 +268,7 @@ static void print_extensions(TSRMLS_D)
 
 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 @@ static inline size_t sapi_cgibin_single_write(const char *str, uint str_length T
                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 @@ static inline size_t sapi_cgibin_single_write(const char *str, uint str_length T
        if (ret <= 0) {
                return 0;
        }
-       return ret;
+       return (size_t)ret;
 #else
        return fwrite(str, 1, MIN(str_length, 16384), stdout);
 #endif