]> granicus.if.org Git - neomutt/commitdiff
crypt-gpgme: prevent crash on bad S/MIME signature
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Mon, 18 Jun 2018 09:21:38 +0000 (11:21 +0200)
committerRichard Russon <rich@flatcap.org>
Sat, 1 Sep 2018 17:06:08 +0000 (18:06 +0100)
Inform the user about the fingerprint being unavailable instead
of crashing if the S/MIME signature is bad.

ncrypt/crypt_gpgme.c

index f05eee90e979b14cb5aaea86aac2c1c3feba77ff..a623d5b4ccdbeba3bf8bf9b2cbabf029674a9762 100644 (file)
@@ -1531,12 +1531,15 @@ static void print_smime_keyinfo(const char *msg, gpgme_signature_t sig,
   }
   else
   {
-    state_puts(_("KeyID "), s);
     if (sig->fpr)
+    {
+      state_puts(_("KeyID "), s);
       state_puts(sig->fpr, s);
+    }
     else
-      state_puts(_("Unknown"), s);
-
+    {
+      state_puts(_("no signature fingerprint available"), s);
+    }
     state_puts("\n", s);
   }