Commit 95255116 authored by Vladimir Marek's avatar Vladimir Marek

Wrap Fqdn in NONULL() to prevent crash with -d5 if Fqdn is NULL

parent d84fb0f2
2008-06-02 09:45 +0200 Rocco Rutte <[email protected]> (d6d04a7f5aea)
* init.c: Allow for printing variable values longer than 256
characters
2008-06-02 09:44 +0200 Rocco Rutte <[email protected]> (b2b844141ac1)
* ChangeLog, rfc822.c: Allow for mail addresses longer than 256
characters (closes #3066).
2008-05-30 16:14 +0200 Rocco Rutte <[email protected]> (2f59be26ad22)
* protos.h: Define prototypes for compatibility functions in protos.h
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment