]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: server - Fix potential crash with previous change on client disconnect
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 17 Jan 2023 06:44:55 +0000 (08:44 +0200)
committerMarkus Valentin <markus.valentin@open-xchange.com>
Tue, 17 Jan 2023 11:10:41 +0000 (12:10 +0100)
Broken by 1418d1e9018fc34287722467c6ee506f3e378e1a

src/lib-http/http-server-response.c

index 21722f6293d567df793fb300a91d9581170a0bde..e5bf5f5e07adec1a37b0d2e212ca8f101feb33be 100644 (file)
@@ -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;