]> granicus.if.org Git - mutt/commitdiff
Fixing a segmentation fault. Here's how to reproduce it: Start
authorThomas Roessler <roessler@does-not-exist.org>
Thu, 6 Mar 2003 21:23:53 +0000 (21:23 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Thu, 6 Mar 2003 21:23:53 +0000 (21:23 +0000)
mutt.  Compose a new message, with an attachment.  Turn on PGP
signing.  Press C-G on the pass phrase prompt.  Turn off PGP
signing.  Try to send the message.

send.c

diff --git a/send.c b/send.c
index f0d5a64b192574fa48668b89ed8747dd31889e06..c73e5576f31079d2e62ee4c2e8820ff3d2b5f0d3 100644 (file)
--- a/send.c
+++ b/send.c
@@ -1458,6 +1458,16 @@ main_loop:
 
   encode_descriptions (msg->content, 1);
   
+  /*
+   * Make sure that clear_content and free_clear_content are
+   * properly initialized -- we may visit this particular place in
+   * the code multiple times, including after a failed call to
+   * mutt_protect().
+   */
+  
+  clear_content = NULL;
+  free_clear_content = 0;
+  
   if (WithCrypto)
   {
     if (msg->security)  
@@ -1470,8 +1480,7 @@ main_loop:
       {
         msg->content = mutt_remove_multipart (msg->content);
         
-        if (pgpkeylist)
-          FREE (&pgpkeylist);
+       FREE (&pgpkeylist);
         
         decode_descriptions (msg->content);
         goto main_loop;