]> git.ipfire.org Git - thirdparty/dovecot/core.git/commit
lib-http: http-client-request - Fix payload assertions in http_client_request_send_mo...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 1 Dec 2020 09:25:09 +0000 (10:25 +0100)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 1 Dec 2020 16:38:47 +0000 (18:38 +0200)
commit5cbc8d7da84f5d6ba54cee3f967aa846115940c2
tree07a13e5cc221d4bd4a3303712496fd9f2d52482f
parentba19713dd2f567dbd2820a94999eef977d90f367
lib-http: http-client-request - Fix payload assertions in http_client_request_send_more().

When the request payload is finished, both req->payload_input and
req->payload_output could be NULL, so the assertions on those being not NULL
need to happen after the check for req->payload_finished.

This particularly causes problems with the
blocking http_client_request_send/finish_payload() API, which constantly
modifies req->payload_input and sets it to NULL to finish the output.

This caused a panic:

Panic: file http-client-request.c: line 1232 (http_client_request_send_more): assertion failed: (req->payload_input != NULL)
src/lib-http/http-client-request.c