+2005-07-24 14:23:25 Thomas Roessler <roessler@does-not-exist.org> (roessler)
+
+ * recvattach.c, smime.c: Fix S/MIME segmentation fault. Bug
+ reported by Mads Martin Joergensen; part fixed by Brendan Cully.
+
+2005-07-24 08:59:44 Brendan Cully <brendan@kublai.com> (brendan)
+
+ * copy.c: Don't assume messages in MMDF mailboxes have From
+ separators when copying them. Spotted by William Lovas. Initial
+ patch by TAKAHASHI Tamotsu.
+
2005-07-23 23:35:17 Byrial Jensen <byrial@image.dk> (brendan)
* curs_main.c, doc/manual.sgml.head, globals.h, main.c, muttlib.c:
2005-01-29 19:15:07 Thomas Glanzmann <sithglan@stud.uni-erlangen.de> (roessler)
* hcache.c: - make hcache.c conform to mutt codingstyle
- - use $Id: ChangeLog,v 3.433 2005/07/23 23:37:05 brendan Exp $ CVS keyword instead of %K% BitKeeper keyword
+ - use $Id: ChangeLog,v 3.435 2005/07/24 14:24:00 roessler Exp $ CVS keyword instead of %K% BitKeeper keyword
2005-01-29 19:15:07 Thomas Glanzmann <sithglan@stud.uni-erlangen.de> (roessler)
int
_mutt_append_message (CONTEXT * dest, FILE * fpin, CONTEXT * src,
- HEADER * hdr, BODY * body, int flags, int chflags)
-{
+ HEADER * hdr, BODY * body, int flags, int chflags) {
+ char buf[STRING];
MESSAGE *msg;
int r;
- if ((msg =
- mx_open_new_message (dest, hdr,
- (src->magic == M_MBOX
- || src->magic == M_MMDF) ? 0 : M_ADD_FROM)) ==
- NULL)
- return -1;
+ fseek(fpin, hdr->offset, 0);
+ if (fgets (buf, sizeof (buf), fpin) == NULL)
+ return (-1);
+ if ((msg = mx_open_new_message (dest, hdr, is_from (buf, NULL, 0, NULL) ? 0 : M_ADD_FROM)) == NULL)
+ return (-1);
if (dest->magic == M_MBOX || dest->magic == M_MMDF)
chflags |= CH_FROM | CH_FORCE_FROM;
chflags |= (dest->magic == M_MAILDIR ? CH_NOSTATUS : CH_UPDATE);
char helpstr[SHORT_STRING];
MUTTMENU *menu;
- BODY *cur;
+ BODY *cur = NULL;
MESSAGE *msg;
FILE *fp;
ATTACHPTR **idx = NULL;
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) &&
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;
}
size_t tmplength = b->length;
int origType = b->type;
FILE *tmpfp = NULL;
+ int rv = 0;
if (!mutt_is_application_smime (b))
return -1;
mutt_mktemp (tempfile);
if ((*fpout = safe_fopen (tempfile, "w+")) == NULL) {
mutt_perror (tempfile);
- return (-1);
+ rv = -1;
+ goto bail;
}
mutt_unlink (tempfile);
- *cur = smime_handle_entity (b, &s, *fpout);
+ if (!(*cur = smime_handle_entity (b, &s, *fpout))) {
+ rv = -1;
+ goto bail;
+ }
+
(*cur)->goodsig = b->goodsig;
- (*cur)->badsig = b->badsig;
+ (*cur)->badsig = b->badsig;
+
+bail:
b->type = origType;
b->length = tmplength;
b->offset = tmpoffset;
- fclose (tmpfp);
-
- rewind (*fpout);
- return (0);
+ safe_fclose (&tmpfp);
+ if (*fpout)
+ rewind (*fpout);
+ return (rv);
}