From: Vladimir Marek Date: Thu, 5 Jun 2008 11:06:17 +0000 (+0200) Subject: Wrap Fqdn in NONULL() to prevent crash with -d5 if Fqdn is NULL X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=95255116d1715f3b2d8b242bc1c478725856c972;p=mutt Wrap Fqdn in NONULL() to prevent crash with -d5 if Fqdn is NULL --- diff --git a/ChangeLog b/ChangeLog index 599bd224..01d047e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-06-02 09:45 +0200 Rocco Rutte (d6d04a7f5aea) + + * init.c: Allow for printing variable values longer than 256 + characters + +2008-06-02 09:44 +0200 Rocco Rutte (b2b844141ac1) + + * ChangeLog, rfc822.c: Allow for mail addresses longer than 256 + characters (closes #3066). + 2008-05-30 16:14 +0200 Rocco Rutte (2f59be26ad22) * protos.h: Define prototypes for compatibility functions in protos.h diff --git a/alias.c b/alias.c index 50ec5a31..90608c90 100644 --- a/alias.c +++ b/alias.c @@ -566,6 +566,8 @@ static int string_is_address(const char *str, const char *u, const char *d) /* returns TRUE if the given address belongs to the user. */ int mutt_addr_is_user (ADDRESS *addr) { + const char *fqdn; + /* NULL address is assumed to be the user. */ if (!addr) { @@ -588,14 +590,16 @@ int mutt_addr_is_user (ADDRESS *addr) dprint (5, (debugfile, "mutt_addr_is_user: yes, %s = %s @ %s \n", addr->mailbox, Username, Hostname)); return 1; } - if (string_is_address(addr->mailbox, Username, mutt_fqdn(0))) + fqdn = mutt_fqdn (0); + if (string_is_address(addr->mailbox, Username, fqdn)) { - dprint (5, (debugfile, "mutt_addr_is_user: yes, %s = %s @ %s \n", addr->mailbox, Username, mutt_fqdn (0))); + dprint (5, (debugfile, "mutt_addr_is_user: yes, %s = %s @ %s \n", addr->mailbox, Username, NONULL(fqdn))); return 1; } - if (string_is_address(addr->mailbox, Username, mutt_fqdn(1))) + fqdn = mutt_fqdn (1); + if (string_is_address(addr->mailbox, Username, fqdn)) { - dprint (5, (debugfile, "mutt_addr_is_user: yes, %s = %s @ %s \n", addr->mailbox, Username, mutt_fqdn (1))); + dprint (5, (debugfile, "mutt_addr_is_user: yes, %s = %s @ %s \n", addr->mailbox, Username, NONULL(fqdn))); return 1; }