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.4.0~3186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3651e94e44e38c5ed548e969ead7728f27bedf8d;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 9df7af858b..0932b1e5e9 100644 --- a/src/lib-http/http-server-response.c +++ b/src/lib-http/http-server-response.c @@ -366,7 +366,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;