From: Martti Rannanjärvi Date: Wed, 10 Aug 2016 12:40:23 +0000 (+0300) Subject: lib-storage: don't crash when pop3c-client timeouts X-Git-Tag: 2.2.26~364 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=caf1bd5c130c585576dd7af6da6dda09429612d3;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: don't crash when pop3c-client timeouts --- diff --git a/src/lib-storage/index/pop3c/pop3c-client.c b/src/lib-storage/index/pop3c/pop3c-client.c index 9388568de6..0b5081e65d 100644 --- a/src/lib-storage/index/pop3c/pop3c-client.c +++ b/src/lib-storage/index/pop3c/pop3c-client.c @@ -871,6 +871,11 @@ int pop3c_client_cmd_stream(struct pop3c_client *client, const char *cmdline, struct pop3c_client_sync_cmd_ctx ctx; const char *reply; + if (client->state == POP3C_CLIENT_STATE_DISCONNECTED) { + *error_r = "Disconnected from server"; + return -1; + } + memset(&ctx, 0, sizeof(ctx)); *input_r = pop3c_client_cmd_stream_async(client, cmdline, pop3c_client_cmd_reply, &ctx);