Re: lmtpd segfaults after update to 2.4.19, seems it wants to act as proxy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 20, 2017, at 05:59 PM, Simon Matter wrote:
> > This is the point where the wrong path is taken.
> >
> >
> > r = mlookup(namebuf, &server, NULL, NULL);
> > if (!r && server) {
> >      /* remote mailbox */
> >      proxy_adddest(&dlist, rcpt, n, server, authuser);
> >      status[n] = nosieve;
> > }
> >
> > mlookup did return something that is not 0, and server has not been set
> > in mlookup. In 2.4.17 there has was "if (server) *server = NULL;"
> 
> Hi Michael,
> 
> Thanks a lot for pointing me into the right direction. Indeed attached
> patch makes it work for me.
> 
> I don't know if this is the proper fix for the issue. Hopefully someone
> who knows better than me can comment.
> 
> Regards,
> Simon

Hi,

Thanks Simon and Michael for the sleuthing!

I've attached what I think is a better patch -- it makes sure the server
variable is correctly initialised to NULL, and mlookup() keeps the
idiomatic implementation whereby it only touches the output variable if
it succeeds.

Are you able to confirm if this patch also fixes the issue for you?  I
don't have a 2.4 environment to test this on

Cheers,

ellie
diff --git a/imap/lmtpd.c b/imap/lmtpd.c
index 5fe507a..8a84248 100644
--- a/imap/lmtpd.c
+++ b/imap/lmtpd.c
@@ -712,9 +712,10 @@ int deliver(message_data_t *msgdata, char *authuser,
 
     /* loop through each recipient, attempting delivery for each */
     for (n = 0; n < nrcpts; n++) {
-	char namebuf[MAX_MAILBOX_BUFFER] = "", *server;
+	char namebuf[MAX_MAILBOX_BUFFER] = "";
 	char userbuf[MAX_MAILBOX_BUFFER];
 	const char *rcpt, *user, *domain, *mailbox;
+	char *server = NULL;
 	int r = 0;
 
 	rcpt = msg_getrcptall(msgdata, n);
----
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux