summaryrefslogtreecommitdiff
path: root/sapi/cgi/cgi_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/cgi/cgi_main.c')
-rw-r--r--sapi/cgi/cgi_main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 8f976a8b93..a0bba17f06 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -699,13 +699,16 @@ static void sapi_cgi_log_message(char *message)
request = (fcgi_request*) SG(server_context);
if (request) {
- int len = (int)strlen(message);
+ int ret, len = (int)strlen(message);
char *buf = malloc(len+2);
memcpy(buf, message, len);
memcpy(buf + len, "\n", sizeof("\n"));
- fcgi_write(request, FCGI_STDERR, buf, (int)(len+1));
+ ret = fcgi_write(request, FCGI_STDERR, buf, (int)(len + 1));
free(buf);
+ if (ret < 0) {
+ php_handle_aborted_connection();
+ }
} else {
fprintf(stderr, "%s\n", message);
}
@@ -2411,7 +2414,7 @@ consult the installation file that came with this distribution, or visit \n\
break;
case ZEND_HANDLE_MAPPED:
if (file_handle.handle.stream.mmap.buf[0] == '#') {
- int i = 1;
+ size_t i = 1;
c = file_handle.handle.stream.mmap.buf[i++];
while (c != '\n' && c != '\r' && i < file_handle.handle.stream.mmap.len) {