summaryrefslogtreecommitdiff
path: root/usr.sbin/httpd
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2014-08-06 20:56:24 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2014-08-06 20:56:24 +0000
commite014a07919fd1914a381f5e5be5b2040e1177d7e (patch)
treebf0753021c9e4eef3b9237d8335d38703d482746 /usr.sbin/httpd
parent97f8cc27997eeddd554914553f1d99950f62a526 (diff)
If the very first fcgi STDOUT record has length 0 the cgi script
didn't send anything back. This is an internal server error. OK reyk@
Diffstat (limited to 'usr.sbin/httpd')
-rw-r--r--usr.sbin/httpd/server_fcgi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/httpd/server_fcgi.c b/usr.sbin/httpd/server_fcgi.c
index 4c1c8562d23..3d16a6c7793 100644
--- a/usr.sbin/httpd/server_fcgi.c
+++ b/usr.sbin/httpd/server_fcgi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server_fcgi.c,v 1.25 2014/08/06 18:40:15 reyk Exp $ */
+/* $OpenBSD: server_fcgi.c,v 1.26 2014/08/06 20:56:23 florian Exp $ */
/*
* Copyright (c) 2014 Florian Obser <florian@openbsd.org>
@@ -468,6 +468,11 @@ server_fcgi_read(struct bufferevent *bev, void *arg)
EVBUFFER_LENGTH(clt->clt_srvevb));
if (clt->clt_fcgi_toread != 0)
break;
+ else if (clt->clt_fcgi_type == FCGI_STDOUT &&
+ !clt->clt_chunk) {
+ server_abort_http(clt, 500, "empty stdout");
+ return;
+ }
/* fallthrough if content_len == 0 */
case FCGI_READ_CONTENT: