summaryrefslogtreecommitdiffstats
path: root/alias.c
diff options
context:
space:
mode:
authorVladimir Marek <Vladimir.Marek@Sun.COM>2008-06-05 13:06:17 +0200
committerVladimir Marek <Vladimir.Marek@Sun.COM>2008-06-05 13:06:17 +0200
commit95255116d1715f3b2d8b242bc1c478725856c972 (patch)
treeae9050d6385688e224103d5bfe64a46a3e62dfd5 /alias.c
parentd84fb0f2f8ef7c7de87c5984628c40e2d10c3105 (diff)
Wrap Fqdn in NONULL() to prevent crash with -d5 if Fqdn is NULL
Diffstat (limited to 'alias.c')
-rw-r--r--alias.c12
1 files changed, 8 insertions, 4 deletions
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;
}