From: Stephan Bosch Date: Mon, 29 Jun 2020 09:56:02 +0000 (+0200) Subject: imap: cmd-notify - Fix segfault ocurring upon NOTIFY error. X-Git-Tag: 2.3.13~440 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=49daa901338a7b4749a48f0b34e199e2f6644f67;p=thirdparty%2Fdovecot%2Fcore.git imap: cmd-notify - Fix segfault ocurring upon NOTIFY error. The client_send_line() function in imap_client_notify_more() uses notify_ns to obtain access to client struct, while that is available as a direct function parameter. And notify_ns is invalid at the end of the for loop, so dereferencing it causes a segmentation fault. --- diff --git a/src/imap/imap-notify.c b/src/imap/imap-notify.c index 7f47aa40b2..481caad6e0 100644 --- a/src/imap/imap-notify.c +++ b/src/imap/imap-notify.c @@ -304,7 +304,7 @@ static int imap_client_notify_more(struct client *client) } if (ret < 0) { - client_send_line(notify_ns->ctx->client, + client_send_line(client, "* NO NOTIFY error, some events may have got lost"); } return ret;