Heinz Diehl wrote:
> please Cc: me since I'm not subscribed to this list.
> 
> Using latest mutt from the hg repository, mutt crashes while choosing a GPG 
> key
> for encryption. Official 1.5.23 works flawlessly. Mutt says:
> 
> Looking for keys matching "x...@xxxx.xx"...Segmentation fault (core dumped)
> 
> This is what's in the logs:
> 
> Feb 10 20:07:10 keera kernel: [ 8156.462648] mutt[13922]: segfault at 0 ip 
> 0000000000454c59 sp 00007ffff8ab7ea0 error 4 in mutt[400000+b5000]
> Feb 10 20:07:10 keera kernel: mutt[13922]: segfault at 0 ip 0000000000454c59 
> sp 00007ffff8ab7ea0 error 4 in mutt[400000+b5000]
> Feb 10 20:07:11 keera systemd-coredump: Process 13922 (mutt) of user 1000 
> dumped core.
> 
> Stack trace of thread 13922:
> #0  0x0000000000454c59 rfc822_parse_adrlist (mutt)
> #1  0x0000000000473f8a pgp_getkeybyaddr (mutt)
> #2  0x0000000000471332 pgp_findKeys (mutt)
> #3  0x00000000004118ed crypt_get_keys (mutt)
> #4  0x000000000045c38b ci_send_message (mutt)
> #5  0x000000000041f363 mutt_index_menu (mutt)
> #6  0x000000000040750b main (mutt)
> #7  0x000000351e81ffe0 __libc_start_main (libc.so.6)
> #8  0x0000000000407551 _start (mutt)

Hmmm... I'm suspecting this has to do with bb3b01f41ed2: "Fix
parse_pub_line to allow an empty User-ID field for a pub record.".  I
thought I had tracked down all the possible uses, but it looks like I
somehow missed this one.

Would you mind trying this patch and seeing if it fixes the problem?

Thanks you,

-Kevin
# HG changeset patch
# User Kevin McCarthy <ke...@8t8.us>
# Date 1423599260 28800
#      Tue Feb 10 12:14:20 2015 -0800
# Node ID b9585d087eb4825e5c6f9fd2150a4043bb16a8b6
# Parent  2fd1b9f17b80c2e7813515e4ebaef5a8d61103ac
Protect addr with NONULL in pgp_getkeybyaddr.

This was introduced by bb3b01f41ed2, but wasn't included in the NONULL
checks added in 9a75aa4bd69e.

diff --git a/pgpkey.c b/pgpkey.c
--- a/pgpkey.c
+++ b/pgpkey.c
@@ -856,17 +856,17 @@
                  k->flags, abilities));
       continue;
     }
 
     match                = 0;   /* any match             */
 
     for (q = k->address; q; q = q->next)
     {
-      r = rfc822_parse_adrlist (NULL, q->addr);
+      r = rfc822_parse_adrlist (NULL, NONULL (q->addr));
 
       for (p = r; p; p = p->next)
       {
        int validity = pgp_id_matches_addr (a, p, q);
 
        if (validity & PGP_KV_MATCH)    /* something matches */
          match = 1;
 

Attachment: signature.asc
Description: PGP signature

Reply via email to