aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-09-07 13:40:11 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-09-07 13:45:10 +0200
commit083dedbb9d068caed31b8c92ba69fc88ab80d009 (patch)
tree7aef6d68f1929926dc7daca146a5ecffb2879a17
parentf6562ddab30feb4bb63d9cda9801dbf607c33d07 (diff)
http.c: Return error if check_length fails
Otherwise, fatal errors coming from the h->cfg.length would be unnoticed, causing slweb to attempt to send a response.
-rw-r--r--http.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/http.c b/http.c
index 0960d85..1ecdb19 100644
--- a/http.c
+++ b/http.c
@@ -1050,6 +1050,13 @@ static int header_cr_line(struct http_ctx *const h)
if (res)
{
+ if (res < 0)
+ {
+ fprintf(stderr, "%s: check_length failed\n",
+ __func__);
+ return res;
+ }
+
h->wctx.close = true;
return start_response(h);
}