From 0fd78e5f406161115fa31ba91e02ac7bfbae1dfd Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Wed, 29 Sep 2021 16:16:48 +0300 Subject: [PATCH] build_header_response(): fail early if no write space is available --- src/microhttpd/connection.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 3e6a4ba0..925f9df5 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c @@ -1980,6 +1980,8 @@ build_header_response (struct MHD_Connection *connection) buf = c->write_buffer; pos = c->write_buffer_append_offset; buf_size = c->write_buffer_size; + if ((NULL == buf) || (0 == buf_size)) + return MHD_NO; /* * The status line * */