From 877ee123514cab235ba3c94da450134409fadb99 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Sat, 20 Nov 2021 14:27:19 +0100 Subject: [PATCH] Fix msg_content --- src/client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client.c b/src/client.c index c4dacbd..69edb34 100644 --- a/src/client.c +++ b/src/client.c @@ -447,8 +447,8 @@ int client_request_handler(sock *client, unsigned long client_num, unsigned int strncmp(content_type, "text/html", 9) == 0) { long content_len = strtol(content_length_f, NULL, 10); - if (content_len <= sizeof(msg_content)) { - fastcgi_dump(&fcgi_conn, msg_content, content_len); + if (content_len <= sizeof(msg_content) - 1) { + fastcgi_dump(&fcgi_conn, msg_content, sizeof(msg_content)); goto respond; } } @@ -492,7 +492,7 @@ int client_request_handler(sock *client, unsigned long client_num, unsigned int strncmp(content_type, "text/html", 9) == 0) { long content_len = strtol(content_length_f, NULL, 10); - if (content_len <= sizeof(msg_content)) { + if (content_len <= sizeof(msg_content) - 1) { ctx.status = res.status->code; ctx.origin = res.status->code >= 400 ? SERVER : NONE; use_rev_proxy = 0;