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

This commit is contained in:
Jérôme Loyet 2012-01-03 22:26:11 +00:00
parent 5f948f63ed
commit e747222100
4 changed files with 9 additions and 5 deletions

4
NEWS
View File

@ -18,6 +18,10 @@ PHP NEWS
- 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:

View 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;

View 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);

View 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