]> granicus.if.org Git - mutt/commitdiff
Change mutt_addr_is_user() to no for a NULL address.
authorKevin McCarthy <kevin@8t8.us>
Sun, 26 May 2019 23:03:40 +0000 (16:03 -0700)
committerKevin McCarthy <kevin@8t8.us>
Sun, 26 May 2019 23:03:40 +0000 (16:03 -0700)
See ticket #140.

The behavior is generating a false 'F' flag for a spam message with an
unparsable From address.

After reviewing the callers, I can't see a reason returning 'yes' in
this case.

Commit 690c2945 fixed a potential segv issue, but the other callers
seem robust against this change in behavior.

alias.c

diff --git a/alias.c b/alias.c
index 0b37fbccf4ed7daeca261826506840e39cb4f159..593d5d999cf304341fa9c5399358cb400e6f0297 100644 (file)
--- a/alias.c
+++ b/alias.c
@@ -614,11 +614,10 @@ int mutt_addr_is_user (ADDRESS *addr)
 {
   const char *fqdn;
 
-  /* NULL address is assumed to be the user. */
   if (!addr)
   {
-    dprint (5, (debugfile, "mutt_addr_is_user: yes, NULL address\n"));
-    return 1;
+    dprint (5, (debugfile, "mutt_addr_is_user: no, NULL address\n"));
+    return 0;
   }
   if (!addr->mailbox)
   {