From: Timo Sirainen Date: Tue, 17 Jan 2023 06:44:55 +0000 (+0200) Subject: lib-http: server - Fix potential crash with previous change on client disconnect X-Git-Tag: 2.3.21~116 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cb666c441a5e61ba526bdda0b05118f65ca4b3e4;p=thirdparty%2Fdovecot%2Fcore.git lib-http: server - Fix potential crash with previous change on client disconnect Broken by 1418d1e9018fc34287722467c6ee506f3e378e1a --- diff --git a/src/lib-http/http-server-response.c b/src/lib-http/http-server-response.c index 21722f6293..e5bf5f5e07 100644 --- a/src/lib-http/http-server-response.c +++ b/src/lib-http/http-server-response.c @@ -357,7 +357,8 @@ int http_server_response_finish_payload_out(struct http_server_response *resp) o_stream_unref(&resp->payload_output); resp->payload_output = NULL; } - if (o_stream_get_buffer_used_size(conn->conn.output) > 0) { + if (conn->conn.output != NULL && + o_stream_get_buffer_used_size(conn->conn.output) > 0) { e_debug(resp->event, "Not quite finished sending response"); conn->output_locked = TRUE;