]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: cmd-notify - Fix segfault ocurring upon NOTIFY error.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Mon, 29 Jun 2020 09:56:02 +0000 (11:56 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 4 Aug 2020 11:43:11 +0000 (11:43 +0000)
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.

src/imap/imap-notify.c

index 7f47aa40b233a104944b64c11b10d256171f3052..481caad6e0255599a5c022557214ec91d05c48eb 100644 (file)
@@ -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;