Patch below. This fixes the segfault, but I'm not sure the behaviour now
(list the public keyring) is what is wanted. The documentation seems to
me to be contardictory, sometimes saying "extract supported public keys",
and sometimes "extracts PGP public keys from the current or tagged
message(s) and adds them to your PGP public key ring". I don't know what
the first means, and the behaviour certianly isn't the second, but is
what the actual code does (modulo segfaulting!).

Unrelatedly:
1) the manpage claims PGPPATH is honoured, but (using gnupg on
linux) this is not true - GNUPGHOME is honoured though.
2) the link to mailing list archives on the page
http://www.mutt.org/mail-lists.html seems to be broken


Patch:


# HG changeset patch
# User Ben Price <[email protected]>
# Date 1383835693 0
#      Thu Nov 07 14:48:13 2013 +0000
# Node ID da373e28b5fc2039876588325b1d5c0ec3f94039
# Parent  3306cb186f49e83edf15aac91c51f4c6131ef8fe
Fix segfault of extract-keys (^K) under gpgme

diff -r 3306cb186f49 -r da373e28b5fc crypt-gpgme.c
--- a/crypt-gpgme.c     Tue Oct 29 00:11:16 2013 -0700
+++ b/crypt-gpgme.c     Thu Nov 07 14:48:13 2013 +0000
@@ -2110,9 +2110,12 @@
     dprint (1, (debugfile, "error converting key file into data object\n"));
     return;
   }
+
+  err = pgp_gpgme_extract_keys (keydata, &out, 0);
+  /* we must keep the file open until gpgme is finished with it */
   safe_fclose (&in);
 
-  if (!pgp_gpgme_extract_keys (keydata, &out, 0))
+  if (!err)
   {
     /* display import results */
     outlen = ftell (out);


Reply via email to