I'm unable with current mutt to send PGP-encrypted mail.  Mutt
crashes during preparation for key selection:

[669/0]$ gdb /sw/bin/mutt core.29412
GNU gdb (GDB) Amazon Linux (7.6.1-51.27.amzn1)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show
copying"
and "show warranty" for details.
This GDB was configured as "x86_64-amazon-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /sw/pkgs/mutt-dev-0.20150508/bin/mutt...done.
[New LWP 29412]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/sw/bin/mutt dgc'.
Program terminated with signal 11, Segmentation fault.
#0  is_email_wsp (c=<error reading variable: Cannot access memory at
address 0x0>) at lib.h:115
115       return strchr(EMAIL_WSP, c) != NULL;
(gdb) bt
#0  is_email_wsp (c=<error reading variable: Cannot access memory at
address 0x0>) at lib.h:115
#1  rfc822_parse_adrlist (top=top@entry=0x0, s=0x0) at rfc822.c:387
#2  0x000000000047c89a in pgp_getkeybyaddr (a=a@entry=0xbc2da0,
abilities=abilities@entry=2, 
    keyring=keyring@entry=PGP_PUBRING) at pgpkey.c:864
#3  0x0000000000479bdb in pgp_findKeys (to=<optimized out>,
cc=<optimized out>, 
    bcc=<optimized out>) at pgp.c:1249
#4  0x0000000000412f15 in crypt_get_keys (msg=0xb8f080,
keylist=keylist@entry=0x7fff87869138)
    at crypt.c:729
#5  0x000000000046395b in ci_send_message (flags=<optimized out>,
flags@entry=0, 
    msg=msg@entry=0xb8f080, tempfile=<optimized out>, ctx=ctx@entry=0x0,
cur=cur@entry=0x0)
    at send.c:1803
#6  0x0000000000407c93 in main (argc=2, argv=<optimized out>,
env=<optimized out>) at main.c:1041

[687/130]$ rpm -q gnupg2
gnupg2-2.0.25-2.29.amzn1.x86_64

[690/0]$ mutt -v|grep GPG
+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME -CRYPT_BACKEND_GPGME  


It looks like this problem goes back at least to this time last year
(going by old mutt builds I still have lying around).  Beyond that I no
longer have shared library compatibility to test (without recompilation;
might as well bisect then).


The attached patch fixes it, sort of -- but the key list still looks
pretty wonky.  Did something change in gnupg output, and we now are
parsing it wrong?  Perhaps most people are using gpgme, and that's why
it's gone unnoticed.  I'm mostly just looking for thoughts at this time.
It's not clear to me that this patch is correct, just a workaround.

# HG changeset patch
# Parent  19861cb37bcbda666aeaf5e867ece6424bb4bc92

diff -r 19861cb37bcb pgpkey.c
--- a/pgpkey.c  Fri May 08 11:44:54 2015 -0500
+++ b/pgpkey.c  Fri May 08 12:28:33 2015 -0500
@@ -861,6 +861,9 @@
 
     for (q = k->address; q; q = q->next)
     {
+      if (q->addr == NULL)
+       continue;
+
       r = rfc822_parse_adrlist (NULL, q->addr);
 
       for (p = r; p; p = p->next)

Reply via email to