]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-oauth2: Don't crash when http response has no payload
authorMartti Rannanjärvi <martti.rannanjarvi@open-xchange.com>
Fri, 22 Mar 2019 06:11:21 +0000 (08:11 +0200)
committerMartti Rannanjärvi <martti.rannanjarvi@open-xchange.com>
Mon, 1 Apr 2019 10:02:44 +0000 (13:02 +0300)
src/lib-oauth2/oauth2-request.c

index ed36ceeb459f902ae8619300dfa23ea7bb196a0b..660ccbefd207176430dc707299be40d3d9db3ad0 100644 (file)
@@ -81,6 +81,13 @@ static void
 oauth2_request_response(const struct http_response *response,
                        struct oauth2_request *req)
 {
+       if (response->payload == NULL) {
+               struct oauth2_request_result res;
+               i_zero(&res);
+               res.error = http_response_get_message(response);
+               oauth2_request_callback(req, &res);
+               return;
+       }
        req->response_status = response->status;
        p_array_init(&req->fields, req->pool, 1);
        req->is = response->payload;