<<< Date Index >>>     <<< Thread Index >>>

Re: smime segmentation fault



Does the attached patch solve the problem?

On Thursday, 21 July 2005 at 11:32, Mads Martin Joergensen wrote:
> Hey all,
> 
> When pressing v to view parts of an smime mail, I get the following
> segmentation fault:
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x40247d0b in fputc () from /lib/tls/libc.so.6
> (gdb) bt
> #0  0x40247d0b in fputc () from /lib/tls/libc.so.6
> #1  0x080af9f6 in state_attach_puts (
>     t=0x80e0430 "[-- Error: unable to create OpenSSL subprocess! --]\n", 
>     s=0xbfffe2ec) at muttlib.c:1291
> #2  0x080bc60d in smime_handle_entity (m=0x8136218, s=0xbfffe2ec, 
>     outFile=0x8138750) at smime.c:1729
> #3  0x080bca24 in smime_decrypt_mime (fpin=0x8121208, fpout=0xbfffe3d8, 
>     b=0x8136218, cur=0xbfffe3e0) at smime.c:1907
> #4  0x0809a1ef in mutt_view_attachments (hdr=0x8135598) at recvattach.c:927
> #5  0x08066582 in mutt_index_menu () at curs_main.c:2087
> #6  0x0807e55e in main (argc=3, argv=0xbffff244) at main.c:940
> #7  0x40202e90 in __libc_start_main () from /lib/tls/libc.so.6
> #8  0x0804c871 in _start () at start.S:119
> (gdb) frame 1  
> #1  0x080af9f6 in state_attach_puts (
>     t=0x80e0430 "[-- Error: unable to create OpenSSL subprocess! --]\n", 
>     s=0xbfffe2ec) at muttlib.c:1291
> 1291        state_putc (*t, s);
> (gdb) print s->fpout
> $1 = (FILE *) 0x0
> 
Index: smime.c
===================================================================
RCS file: /home/roessler/cvs/mutt/smime.c,v
retrieving revision 3.38
diff -u -p -r3.38 smime.c
--- smime.c     28 Feb 2005 14:37:09 -0000      3.38
+++ smime.c     24 Jul 2005 00:29:05 -0000
@@ -1716,7 +1716,8 @@ static BODY *smime_handle_entity (BODY *
   {
     fclose (smimeout); smimeout = NULL;
     mutt_unlink (tmpfname);
-    state_attach_puts (_("[-- Error: unable to create OpenSSL subprocess! 
--]\n"), s);
+    if (s->flags & M_DISPLAY)
+      state_attach_puts (_("[-- Error: unable to create OpenSSL subprocess! 
--]\n"), s);
     return NULL;
   }
   else if ((type & SIGNOPAQUE) &&
@@ -1726,7 +1727,8 @@ static BODY *smime_handle_entity (BODY *
   {
     fclose (smimeout); smimeout = NULL;
     mutt_unlink (tmpfname);
-    state_attach_puts (_("[-- Error: unable to create OpenSSL subprocess! 
--]\n"), s);
+    if (s->flags & M_DISPLAY)
+      state_attach_puts (_("[-- Error: unable to create OpenSSL subprocess! 
--]\n"), s);
     return NULL;
   }
 

Attachment: pgpdMweZiWMfx.pgp
Description: PGP signature