From b0cd31d49e2456f9929e27a3342dd9423d2deb1c Mon Sep 17 00:00:00 2001 From: "LevitatingBusinessMan (Rein Fernhout)" Date: Tue, 28 May 2024 22:57:04 +0200 Subject: [PATCH 1/2] allow no headers --- fcgiwrap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fcgiwrap.c b/fcgiwrap.c index b44d8aa..4238404 100644 --- a/fcgiwrap.c +++ b/fcgiwrap.c @@ -150,8 +150,8 @@ enum char_class_t { static const unsigned char header_state_machine[REPLY_STATE_MAX][CC_MAX] = { [REPLY_STATE_INIT] = { [CC_NORMAL] = REPLY_STATE_HEADER, - [CC_CR] = ACTION_ERROR, - [CC_LF] = ACTION_ERROR, + [CC_CR] = REPLY_STATE_BODY | ACTION_END, + [CC_LF] = REPLY_STATE_BODY | ACTION_END, }, [REPLY_STATE_HEADER] = { [CC_NORMAL] = REPLY_STATE_HEADER, From 5081a83db0bd3c9e03880337a5a80648932a0df3 Mon Sep 17 00:00:00 2001 From: "LevitatingBusinessMan (Rein Fernhout)" Date: Tue, 28 May 2024 22:57:58 +0200 Subject: [PATCH 2/2] specify __noreturn__ fork cgi_error --- fcgiwrap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fcgiwrap.c b/fcgiwrap.c index 4238404..077a23e 100644 --- a/fcgiwrap.c +++ b/fcgiwrap.c @@ -500,6 +500,7 @@ static bool is_allowed_program(const char *program) { return false; } +__attribute__((__noreturn__)) static void cgi_error(const char *message, const char *reason, const char *filename) { printf("Status: %s\r\nContent-Type: text/plain\r\n\r\n%s\r\n",