From 083dedbb9d068caed31b8c92ba69fc88ab80d009 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Thu, 7 Sep 2023 13:40:11 +0200 Subject: 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. --- http.c | 7 +++++++ 1 file changed, 7 insertions(+) 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); } -- cgit v1.2.3