Re: issue with smime and mutt 1.5.5.1
On Sun, Jan 04, 2004 at 08:38:45PM -0600, Will Fiveash wrote:
>
> Note that in smime_decrypt_mime() in smime.c I see:
>
> mutt_unlink (tempfile);
> s.fpout = tmpfp;
> mutt_decode_attachment (b, &s);
> fflush (tmpfp);
> b->length = ftell (s.fpout);
> b->offset = 0;
> rewind (tmpfp);
> s.fpin = tmpfp;
> s.fpout = 0;
> ^^^^^^^^^^^ This is a problem.
>
> mutt_mktemp (tempfile);
> if ((*fpout = safe_fopen (tempfile, "w+")) == NULL)
> {
> mutt_perror (tempfile);
> return (-1);
> }
> mutt_unlink (tempfile);
>
> *cur = smime_handle_entity (b, &s, *fpout);
> ^^^^^^^^^^^^^^^^^^^^^^^^^^ this calls state_attach_puts()
> which expects that s->fpout != NULL.
Actually, looking at smime_decrypt_mime() some more I see:
*cur = smime_handle_entity (b, &s, *fpout);
(*cur)->goodsig = b->goodsig;
(*cur)->badsig = b->badsig;
Note, smime_handle_entity() can return NULL (in numerous places). I'm
going to stop e-mailing about the smime bugs because the code looks like
it has quite a few problems. Unfortunately, I don't have the time to
debug it so I hope someone that does can clean this up.
--
Will Fiveash