From: florian Date: Wed, 6 Aug 2014 20:56:23 +0000 (+0000) Subject: If the very first fcgi STDOUT record has length 0 the cgi script X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b1450811dd4c92aca40b4e4fc11e1ba7dcbc4234;p=openbsd 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@ --- 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 @@ -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: