From: Rocco Rutte Date: Sun, 21 Jun 2009 19:57:28 +0000 (+0200) Subject: Pass buffer size to mutt_mktemp() X-Git-Tag: mutt-1-5-21-rel~216 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9dcf475e0d300bbfb90e66335c41c0035c2dcf37;p=mutt Pass buffer size to mutt_mktemp() --- diff --git a/attach.c b/attach.c index 106d68f1..238dbc29 100644 --- a/attach.c +++ b/attach.c @@ -169,7 +169,7 @@ int mutt_compose_attachment (BODY *a) /* Remove headers by copying out data to another file, then * copying the file back */ fseeko (fp, b->offset, 0); - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if ((tfp = safe_fopen (tempfile, "w")) == NULL) { mutt_perror _("Failure to open file to strip headers."); @@ -508,7 +508,7 @@ int mutt_view_attachment (FILE *fp, BODY *a, int flag, HEADER *hdr, mutt_adv_mktemp (pagerfile, sizeof(pagerfile)); } else - mutt_mktemp (pagerfile); + mutt_mktemp (pagerfile, sizeof (pagerfile)); } if (use_mailcap) @@ -1043,7 +1043,7 @@ int mutt_print_attachment (FILE *fp, BODY *a) ifp = NULL; fpout = NULL; - mutt_mktemp (newfile); + mutt_mktemp (newfile, sizeof (newfile)); if (mutt_decode_save_attachment (fp, a, newfile, M_PRINTING, 0) == 0) { diff --git a/commands.c b/commands.c index 7d9c90d2..3b009978 100644 --- a/commands.c +++ b/commands.c @@ -109,7 +109,7 @@ int mutt_display_message (HEADER *cur) } - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if ((fpout = safe_fopen (tempfile, "w")) == NULL) { mutt_error _("Could not create temporary file!"); diff --git a/crypt.c b/crypt.c index 60b594d0..0bd2f305 100644 --- a/crypt.c +++ b/crypt.c @@ -593,7 +593,7 @@ void crypt_extract_keys_from_messages (HEADER * h) if (!WithCrypto) return; - mutt_mktemp (tempfname); + mutt_mktemp (tempfname, sizeof (tempfname)); if (!(fpout = safe_fopen (tempfname, "w"))) { mutt_perror (tempfname); @@ -844,7 +844,7 @@ int mutt_signed_handler (BODY *a, STATE *s) if (sigcnt) { - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if (crypt_write_signed (a, s, tempfile) == 0) { for (i = 0; i < sigcnt; i++) diff --git a/editmsg.c b/editmsg.c index ecba7544..153b1397 100644 --- a/editmsg.c +++ b/editmsg.c @@ -64,7 +64,7 @@ static int edit_one_message (CONTEXT *ctx, HEADER *cur) struct stat sb; time_t mtime = 0; - mutt_mktemp (tmp); + mutt_mktemp (tmp, sizeof (tmp)); omagic = DefaultMagic; DefaultMagic = M_MBOX; diff --git a/handler.c b/handler.c index 49e74ab5..25e1a0d3 100644 --- a/handler.c +++ b/handler.c @@ -1644,7 +1644,7 @@ int mutt_body_handler (BODY *b, STATE *s) { /* decode to a tempfile, saving the original destination */ fp = s->fpout; - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if ((s->fpout = safe_fopen (tempfile, "w")) == NULL) { mutt_error _("Unable to open temporary file!"); diff --git a/headers.c b/headers.c index 5d22489f..72ee3eb2 100644 --- a/headers.c +++ b/headers.c @@ -44,7 +44,7 @@ void mutt_edit_headers (const char *editor, struct stat st; LIST *cur, **last = NULL, *tmp; - mutt_mktemp (path); + mutt_mktemp (path, sizeof (path)); if ((ofp = safe_fopen (path, "w")) == NULL) { mutt_perror (path); diff --git a/help.c b/help.c index 10ad9cf2..6d54059f 100644 --- a/help.c +++ b/help.c @@ -340,7 +340,7 @@ void mutt_help (int menu) FILE *f; struct binding_t *funcs; - mutt_mktemp (t); + mutt_mktemp (t, sizeof (t)); funcs = km_get_table (menu); desc = mutt_getnamebyvalue (menu, Menus); diff --git a/history.c b/history.c index 68528163..9efbdb47 100644 --- a/history.c +++ b/history.c @@ -123,7 +123,7 @@ static void shrink_histfile (void) for(hclass = HC_FIRST; hclass < HC_LAST; hclass++) if (n[hclass] > SaveHist) { - mutt_mktemp (tmpfname); + mutt_mktemp (tmpfname, sizeof (tmpfname)); if ((tmp = safe_fopen (tmpfname, "w+")) == NULL) mutt_perror (tmpfname); break; diff --git a/imap/message.c b/imap/message.c index 3d64c0d5..b0911529 100644 --- a/imap/message.c +++ b/imap/message.c @@ -102,7 +102,7 @@ int imap_read_headers (IMAP_DATA* idata, int msgbegin, int msgend) /* instead of downloading all headers and then parsing them, we parse them * as they come in. */ - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if (!(fp = safe_fopen (tempfile, "w+"))) { mutt_error (_("Could not create temporary file %s"), tempfile); @@ -437,7 +437,7 @@ int imap_fetch_message (MESSAGE *msg, CONTEXT *ctx, int msgno) if (!(msg->fp = msg_cache_put (idata, h))) { cache->uid = HEADER_DATA(h)->uid; - mutt_mktemp (path); + mutt_mktemp (path, sizeof (path)); cache->path = safe_strdup (path); if (!(msg->fp = safe_fopen (path, "w+"))) { diff --git a/main.c b/main.c index baea582e..b8a93cce 100644 --- a/main.c +++ b/main.c @@ -896,7 +896,7 @@ int main (int argc, char **argv) else fin = NULL; - mutt_mktemp (buf); + mutt_mktemp (buf, sizeof (buf)); tempfile = safe_strdup (buf); if (draftFile) diff --git a/mbox.c b/mbox.c index 6c659ba7..e6f3f5ee 100644 --- a/mbox.c +++ b/mbox.c @@ -769,7 +769,7 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint) return (-1); /* Create a temporary file to write the new version of the mailbox in. */ - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if ((i = open (tempfile, O_WRONLY | O_EXCL | O_CREAT, 0600)) == -1 || (fp = fdopen (i, "w")) == NULL) { diff --git a/muttlib.c b/muttlib.c index 8539c8fa..12dd96e0 100644 --- a/muttlib.c +++ b/muttlib.c @@ -743,9 +743,9 @@ void mutt_merge_envelopes(ENVELOPE* base, ENVELOPE** extra) mutt_free_envelope(extra); } -void _mutt_mktemp (char *s, const char *src, int line) +void _mutt_mktemp (char *s, size_t slen, const char *src, int line) { - snprintf (s, _POSIX_PATH_MAX, "%s/mutt-%s-%d-%d-%d", NONULL (Tempdir), NONULL(Hostname), (int) getuid(), (int) getpid (), Counter++); + snprintf (s, slen, "%s/mutt-%s-%d-%d-%d", NONULL (Tempdir), NONULL(Hostname), (int) getuid(), (int) getpid (), Counter++); dprint (3, (debugfile, "%s:%d: mutt_mktemp returns \"%s\".\n", src, line, s)); unlink (s); } diff --git a/mx.c b/mx.c index ec724a92..9cf245ec 100644 --- a/mx.c +++ b/mx.c @@ -1201,7 +1201,7 @@ static int imap_open_new_message (MESSAGE *msg, CONTEXT *dest, HEADER *hdr) { char tmp[_POSIX_PATH_MAX]; - mutt_mktemp(tmp); + mutt_mktemp (tmp, sizeof (tmp)); if ((msg->fp = safe_fopen (tmp, "w")) == NULL) { mutt_perror (tmp); diff --git a/pattern.c b/pattern.c index 489a1d03..e92c95d7 100644 --- a/pattern.c +++ b/pattern.c @@ -162,7 +162,7 @@ msg_search (CONTEXT *ctx, pattern_t* pat, int msgno) memset (&s, 0, sizeof (s)); s.fpin = msg->fp; s.flags = M_CHARCONV; - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if ((s.fpout = safe_fopen (tempfile, "w+")) == NULL) { mutt_perror (tempfile); diff --git a/pgp.c b/pgp.c index 0318060c..ab06b7a3 100644 --- a/pgp.c +++ b/pgp.c @@ -311,7 +311,7 @@ int pgp_application_pgp_handler (BODY *m, STATE *s) have_any_sigs = have_any_sigs || (clearsign && (s->flags & M_VERIFY)); /* Copy PGP material to temporary file */ - mutt_mktemp (tmpfname); + mutt_mktemp (tmpfname, sizeof (tmpfname)); if ((tmpfp = safe_fopen (tmpfname, "w+")) == NULL) { mutt_perror (tmpfname); @@ -350,7 +350,7 @@ int pgp_application_pgp_handler (BODY *m, STATE *s) /* Invoke PGP if needed */ if (!clearsign || (s->flags & M_VERIFY)) { - mutt_mktemp (outfile); + mutt_mktemp (outfile, sizeof (outfile)); if ((pgpout = safe_fopen (outfile, "w+")) == NULL) { mutt_perror (tmpfname); @@ -535,7 +535,7 @@ static int pgp_check_traditional_one_body (FILE *fp, BODY *b, int tagged_only) if (tagged_only && !b->tagged) return 0; - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if (mutt_decode_save_attachment (fp, b, tempfile, 0, 0) != 0) { unlink (tempfile); @@ -623,7 +623,7 @@ int pgp_verify_one (BODY *sigbdy, STATE *s, const char *tempfile) mutt_copy_bytes (s->fpin, fp, sigbdy->length); safe_fclose (&fp); - mutt_mktemp(pgperrfile); + mutt_mktemp (pgperrfile, sizeof (pgperrfile)); if(!(pgperr = safe_fopen(pgperrfile, "w+"))) { mutt_perror(pgperrfile); @@ -682,7 +682,7 @@ void pgp_extract_keys_from_messages (HEADER *h) return; } - mutt_mktemp (tempfname); + mutt_mktemp (tempfname, sizeof (tempfname)); if (!(fpout = safe_fopen (tempfname, "w"))) { mutt_perror (tempfname); @@ -738,7 +738,7 @@ static void pgp_extract_keys_from_attachment (FILE *fp, BODY *top) FILE *tempfp; char tempfname[_POSIX_PATH_MAX]; - mutt_mktemp (tempfname); + mutt_mktemp (tempfname, sizeof (tempfname)); if (!(tempfp = safe_fopen (tempfname, "w"))) { mutt_perror (tempfname); @@ -795,7 +795,7 @@ BODY *pgp_decrypt_part (BODY *a, STATE *s, FILE *fpout, BODY *p) pid_t thepid; int rv; - mutt_mktemp (pgperrfile); + mutt_mktemp (pgperrfile, sizeof (pgperrfile)); if ((pgperr = safe_fopen (pgperrfile, "w+")) == NULL) { mutt_perror (pgperrfile); @@ -803,7 +803,7 @@ BODY *pgp_decrypt_part (BODY *a, STATE *s, FILE *fpout, BODY *p) } unlink (pgperrfile); - mutt_mktemp (pgptmpfile); + mutt_mktemp (pgptmpfile, sizeof (pgptmpfile)); if((pgptmp = safe_fopen (pgptmpfile, "w")) == NULL) { mutt_perror (pgptmpfile); @@ -911,7 +911,7 @@ int pgp_decrypt_mime (FILE *fpin, FILE **fpout, BODY *b, BODY **cur) memset (&s, 0, sizeof (s)); s.fpin = fpin; - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if ((*fpout = safe_fopen (tempfile, "w+")) == NULL) { mutt_perror (tempfile); @@ -953,7 +953,7 @@ int pgp_encrypted_handler (BODY *a, STATE *s) */ a = a->next; - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if ((fpout = safe_fopen (tempfile, "w+")) == NULL) { if (s->flags & M_DISPLAY) @@ -1024,13 +1024,13 @@ BODY *pgp_sign_message (BODY *a) convert_to_7bit (a); /* Signed data _must_ be in 7-bit format. */ - mutt_mktemp (sigfile); + mutt_mktemp (sigfile, sizeof (sigfile)); if ((fp = safe_fopen (sigfile, "w")) == NULL) { return (NULL); } - mutt_mktemp (signedfile); + mutt_mktemp (signedfile, sizeof (signedfile)); if ((sfp = safe_fopen(signedfile, "w")) == NULL) { mutt_perror(signedfile); @@ -1272,14 +1272,14 @@ BODY *pgp_encrypt_message (BODY *a, char *keylist, int sign) int empty = 0; pid_t thepid; - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if ((fpout = safe_fopen (tempfile, "w+")) == NULL) { mutt_perror (tempfile); return (NULL); } - mutt_mktemp (pgperrfile); + mutt_mktemp (pgperrfile, sizeof (pgperrfile)); if ((pgperr = safe_fopen (pgperrfile, "w+")) == NULL) { mutt_perror (pgperrfile); @@ -1289,7 +1289,7 @@ BODY *pgp_encrypt_message (BODY *a, char *keylist, int sign) } unlink (pgperrfile); - mutt_mktemp(pgpinfile); + mutt_mktemp (pgpinfile, sizeof (pgpinfile)); if((fptmp = safe_fopen(pgpinfile, "w")) == NULL) { mutt_perror(pgpinfile); @@ -1418,7 +1418,7 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist) return NULL; } - mutt_mktemp (pgpinfile); + mutt_mktemp (pgpinfile, sizeof (pgpinfile)); if ((pgpin = safe_fopen (pgpinfile, "w")) == NULL) { mutt_perror (pgpinfile); @@ -1463,8 +1463,8 @@ BODY *pgp_traditional_encryptsign (BODY *a, int flags, char *keylist) safe_fclose (&fp); safe_fclose (&pgpin); - mutt_mktemp (pgpoutfile); - mutt_mktemp (pgperrfile); + mutt_mktemp (pgpoutfile, sizeof (pgpoutfile)); + mutt_mktemp (pgperrfile, sizeof (pgperrfile)); if ((pgpout = safe_fopen (pgpoutfile, "w+")) == NULL || (pgperr = safe_fopen (pgperrfile, "w+")) == NULL) { diff --git a/pgpkey.c b/pgpkey.c index d837013c..04bca9f7 100644 --- a/pgpkey.c +++ b/pgpkey.c @@ -547,7 +547,7 @@ static pgp_key_t pgp_select_key (pgp_key_t keys, case OP_VERIFY_KEY: - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if ((devnull = fopen ("/dev/null", "w")) == NULL) /* __FOPEN_CHECKED__ */ { mutt_perror _("Can't open /dev/null"); @@ -730,7 +730,7 @@ BODY *pgp_make_key_attachment (char *tempf) if (!tempf) { - mutt_mktemp (tempfb); + mutt_mktemp (tempfb, sizeof (tempfb)); tempf = tempfb; } diff --git a/pgpmicalg.c b/pgpmicalg.c index d22c50cc..37519825 100644 --- a/pgpmicalg.c +++ b/pgpmicalg.c @@ -170,7 +170,7 @@ static short pgp_find_hash (const char *fname) short rv = -1; - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if ((out = safe_fopen (tempfile, "w+")) == NULL) { mutt_perror (tempfile); diff --git a/pop.c b/pop.c index ec1af232..0c98942a 100644 --- a/pop.c +++ b/pop.c @@ -67,7 +67,7 @@ static int pop_read_header (POP_DATA *pop_data, HEADER *h) char buf[LONG_STRING]; char tempfile[_POSIX_PATH_MAX]; - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if (!(f = safe_fopen (tempfile, "w+"))) { mutt_perror (tempfile); @@ -568,7 +568,7 @@ int pop_fetch_message (MESSAGE* msg, CONTEXT* ctx, int msgno) { /* no */ bcache = 0; - mutt_mktemp (path); + mutt_mktemp (path, sizeof (path)); if (!(msg->fp = safe_fopen (path, "w+"))) { mutt_perror (path); diff --git a/protos.h b/protos.h index fb9f3047..4606c202 100644 --- a/protos.h +++ b/protos.h @@ -221,8 +221,8 @@ void mutt_make_misc_reply_headers (ENVELOPE *env, CONTEXT *ctx, HEADER *cur, ENV void mutt_make_post_indent (CONTEXT *ctx, HEADER *cur, FILE *out); void mutt_merge_envelopes(ENVELOPE* base, ENVELOPE** extra); void mutt_message_to_7bit (BODY *, FILE *); -#define mutt_mktemp(a) _mutt_mktemp (a, __FILE__, __LINE__) -void _mutt_mktemp (char *, const char *, int); +#define mutt_mktemp(a,b) _mutt_mktemp (a, b, __FILE__, __LINE__) +void _mutt_mktemp (char *, size_t, const char *, int); void mutt_normalize_time (struct tm *); void mutt_paddstr (int, const char *); void mutt_parse_mime_message (CONTEXT *ctx, HEADER *); diff --git a/recvattach.c b/recvattach.c index e2c4c773..fc75b1bc 100644 --- a/recvattach.c +++ b/recvattach.c @@ -584,7 +584,7 @@ mutt_query_pipe_attachment (char *command, FILE *fp, BODY *body, int filter) CLEARLINE (LINES-1); return; } - mutt_mktemp (tfile); + mutt_mktemp (tfile, sizeof (tfile)); } else tfile[0] = 0; @@ -734,7 +734,7 @@ static void print_attachment_list (FILE *fp, int tag, BODY *top, STATE *state) char newfile[_POSIX_PATH_MAX] = ""; FILE *ifp; - mutt_mktemp (newfile); + mutt_mktemp (newfile, sizeof (newfile)); if (mutt_decode_save_attachment (fp, top, newfile, M_PRINTING, 0) == 0) { if ((ifp = fopen (newfile, "r")) != NULL) diff --git a/recvcmd.c b/recvcmd.c index 5f4511f6..26c39d2b 100644 --- a/recvcmd.c +++ b/recvcmd.c @@ -435,7 +435,7 @@ static void attach_forward_bodies (FILE * fp, HEADER * hdr, tmphdr->env = mutt_new_envelope (); mutt_make_forward_subject (tmphdr->env, Context, parent); - mutt_mktemp (tmpbody); + mutt_mktemp (tmpbody, sizeof (tmpbody)); if ((tmpfp = safe_fopen (tmpbody, "w")) == NULL) { mutt_error (_("Can't open temporary file %s."), tmpbody); @@ -613,7 +613,7 @@ static void attach_forward_msgs (FILE * fp, HEADER * hdr, /* no MIME encapsulation */ - mutt_mktemp (tmpbody); + mutt_mktemp (tmpbody, sizeof (tmpbody)); if (!(tmpfp = safe_fopen (tmpbody, "w"))) { mutt_error (_("Can't create %s."), tmpbody); @@ -863,7 +863,7 @@ void mutt_attach_reply (FILE * fp, HEADER * hdr, return; } - mutt_mktemp (tmpbody); + mutt_mktemp (tmpbody, sizeof (tmpbody)); if ((tmpfp = safe_fopen (tmpbody, "w")) == NULL) { mutt_error (_("Can't create %s."), tmpbody); diff --git a/rfc3676.c b/rfc3676.c index bbe95798..de1683e7 100644 --- a/rfc3676.c +++ b/rfc3676.c @@ -284,7 +284,7 @@ void rfc3676_space_stuff (HEADER* hdr) if ((in = safe_fopen (hdr->content->filename, "r")) == NULL) return; - mutt_mktemp (tmpfile); + mutt_mktemp (tmpfile, sizeof (tmpfile)); if ((out = safe_fopen (tmpfile, "w+")) == NULL) { safe_fclose (&in); diff --git a/send.c b/send.c index c509df17..511cd8a8 100644 --- a/send.c +++ b/send.c @@ -984,7 +984,7 @@ static int send_message (HEADER *msg) #endif /* Write out the message in MIME form. */ - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if ((tempfp = safe_fopen (tempfile, "w")) == NULL) return (-1); @@ -1210,7 +1210,7 @@ ci_send_message (int flags, /* send mode */ if (!tempfile) { - mutt_mktemp (buffer); + mutt_mktemp (buffer, sizeof (buffer)); tempfp = safe_fopen (buffer, "w+"); msg->content->filename = safe_strdup (buffer); } diff --git a/sendlib.c b/sendlib.c index 73206652..a6e7738c 100644 --- a/sendlib.c +++ b/sendlib.c @@ -1047,7 +1047,7 @@ void mutt_message_to_7bit (BODY *a, FILE *fp) a->length = sb.st_size; } - mutt_mktemp (temp); + mutt_mktemp (temp, sizeof (temp)); if (!(fpout = safe_fopen (temp, "w+"))) { mutt_perror ("fopen"); @@ -1118,7 +1118,7 @@ static void transform_to_7bit (BODY *a, FILE *fpin) a->noconv = 1; a->force_charset = 1; - mutt_mktemp (buff); + mutt_mktemp (buff, sizeof (buff)); if ((s.fpout = safe_fopen (buff, "w")) == NULL) { mutt_perror ("fopen"); @@ -1261,7 +1261,7 @@ BODY *mutt_make_message_attach (CONTEXT *ctx, HEADER *hdr, int attach_msg) } } - mutt_mktemp (buffer); + mutt_mktemp (buffer, sizeof (buffer)); if ((fp = safe_fopen (buffer, "w+")) == NULL) return NULL; @@ -2097,7 +2097,7 @@ send_msg (const char *path, char **args, const char *msg, char **tempfile) { char tmp[_POSIX_PATH_MAX]; - mutt_mktemp (tmp); + mutt_mktemp (tmp, sizeof (tmp)); *tempfile = safe_strdup (tmp); } @@ -2453,7 +2453,7 @@ static int _mutt_bounce_message (FILE *fp, HEADER *h, ADDRESS *to, const char *r if (!fp) fp = msg->fp; - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if ((f = safe_fopen (tempfile, "w")) != NULL) { int ch_flags = CH_XMIT | CH_NONEWLINE | CH_NOQFROM; @@ -2615,7 +2615,7 @@ int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid, int post, */ if (f.magic == M_MMDF || f.magic == M_MBOX) { - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if ((tempfp = safe_fopen (tempfile, "w+")) == NULL) { mutt_perror (tempfile); diff --git a/smime.c b/smime.c index e4a784fb..2068fcfe 100644 --- a/smime.c +++ b/smime.c @@ -825,7 +825,7 @@ static int smime_handle_cert_email (char *certificate, char *mailbox, int ret = -1, count = 0; pid_t thepid; - mutt_mktemp (tmpfname); + mutt_mktemp (tmpfname, sizeof (tmpfname)); if ((fperr = safe_fopen (tmpfname, "w+")) == NULL) { mutt_perror (tmpfname); @@ -833,7 +833,7 @@ static int smime_handle_cert_email (char *certificate, char *mailbox, } mutt_unlink (tmpfname); - mutt_mktemp (tmpfname); + mutt_mktemp (tmpfname, sizeof (tmpfname)); if ((fpout = safe_fopen (tmpfname, "w+")) == NULL) { safe_fclose (&fperr); @@ -916,7 +916,7 @@ static char *smime_extract_certificate (char *infile) int empty; - mutt_mktemp (tmpfname); + mutt_mktemp (tmpfname, sizeof (tmpfname)); if ((fperr = safe_fopen (tmpfname, "w+")) == NULL) { mutt_perror (tmpfname); @@ -924,7 +924,7 @@ static char *smime_extract_certificate (char *infile) } mutt_unlink (tmpfname); - mutt_mktemp (pk7out); + mutt_mktemp (pk7out, sizeof (pk7out)); if ((fpout = safe_fopen (pk7out, "w+")) == NULL) { safe_fclose (&fperr); @@ -968,7 +968,7 @@ static char *smime_extract_certificate (char *infile) safe_fclose (&fpout); - mutt_mktemp (certfile); + mutt_mktemp (certfile, sizeof (certfile)); if ((fpout = safe_fopen (certfile, "w+")) == NULL) { safe_fclose (&fperr); @@ -1025,7 +1025,7 @@ static char *smime_extract_signer_certificate (char *infile) int empty; - mutt_mktemp (tmpfname); + mutt_mktemp (tmpfname, sizeof (tmpfname)); if ((fperr = safe_fopen (tmpfname, "w+")) == NULL) { mutt_perror (tmpfname); @@ -1034,7 +1034,7 @@ static char *smime_extract_signer_certificate (char *infile) mutt_unlink (tmpfname); - mutt_mktemp (certfile); + mutt_mktemp (certfile, sizeof (certfile)); if ((fpout = safe_fopen (certfile, "w+")) == NULL) { safe_fclose (&fperr); @@ -1092,7 +1092,7 @@ void smime_invoke_import (char *infile, char *mailbox) FILE *smimein=NULL, *fpout = NULL, *fperr = NULL; pid_t thepid=-1; - mutt_mktemp (tmpfname); + mutt_mktemp (tmpfname, sizeof (tmpfname)); if ((fperr = safe_fopen (tmpfname, "w+")) == NULL) { mutt_perror (tmpfname); @@ -1100,7 +1100,7 @@ void smime_invoke_import (char *infile, char *mailbox) } mutt_unlink (tmpfname); - mutt_mktemp (tmpfname); + mutt_mktemp (tmpfname, sizeof (tmpfname)); if ((fpout = safe_fopen (tmpfname, "w+")) == NULL) { safe_fclose (&fperr); @@ -1158,7 +1158,7 @@ int smime_verify_sender(HEADER *h) FILE *fpout; int retval=1; - mutt_mktemp (tempfname); + mutt_mktemp (tempfname, sizeof (tempfname)); if (!(fpout = safe_fopen (tempfname, "w"))) { mutt_perror (tempfname); @@ -1263,14 +1263,14 @@ BODY *smime_build_smime_entity (BODY *a, char *certlist) int err = 0, empty; pid_t thepid; - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if ((fpout = safe_fopen (tempfile, "w+")) == NULL) { mutt_perror (tempfile); return (NULL); } - mutt_mktemp (smimeerrfile); + mutt_mktemp (smimeerrfile, sizeof (smimeerrfile)); if ((smimeerr = safe_fopen (smimeerrfile, "w+")) == NULL) { mutt_perror (smimeerrfile); @@ -1280,7 +1280,7 @@ BODY *smime_build_smime_entity (BODY *a, char *certlist) } mutt_unlink (smimeerrfile); - mutt_mktemp (smimeinfile); + mutt_mktemp (smimeinfile, sizeof (smimeinfile)); if ((fptmp = safe_fopen (smimeinfile, "w+")) == NULL) { mutt_perror (smimeinfile); @@ -1399,7 +1399,7 @@ BODY *smime_sign_message (BODY *a ) convert_to_7bit (a); /* Signed data _must_ be in 7-bit format. */ - mutt_mktemp (filetosign); + mutt_mktemp (filetosign, sizeof (filetosign)); if ((sfp = safe_fopen (filetosign, "w+")) == NULL) { mutt_perror (filetosign); @@ -1408,7 +1408,7 @@ BODY *smime_sign_message (BODY *a ) return NULL; } - mutt_mktemp (signedfile); + mutt_mktemp (signedfile, sizeof (signedfile)); if ((smimeout = safe_fopen (signedfile, "w+")) == NULL) { mutt_perror (signedfile); @@ -1604,7 +1604,7 @@ int smime_verify_one (BODY *sigbdy, STATE *s, const char *tempfile) sigbdy->type = origType; - mutt_mktemp (smimeerrfile); + mutt_mktemp (smimeerrfile, sizeof (smimeerrfile)); if (!(smimeerr = safe_fopen (smimeerrfile, "w+"))) { mutt_perror (smimeerrfile); @@ -1688,14 +1688,14 @@ static BODY *smime_handle_entity (BODY *m, STATE *s, FILE *outFile) if (!(type & APPLICATION_SMIME)) return NULL; - mutt_mktemp (outfile); + mutt_mktemp (outfile, sizeof (outfile)); if ((smimeout = safe_fopen (outfile, "w+")) == NULL) { mutt_perror (outfile); return NULL; } - mutt_mktemp (errfile); + mutt_mktemp (errfile, sizeof (errfile)); if ((smimeerr = safe_fopen (errfile, "w+")) == NULL) { mutt_perror (errfile); @@ -1705,7 +1705,7 @@ static BODY *smime_handle_entity (BODY *m, STATE *s, FILE *outFile) mutt_unlink (errfile); - mutt_mktemp (tmpfname); + mutt_mktemp (tmpfname, sizeof (tmpfname)); if ((tmpfp = safe_fopen (tmpfname, "w+")) == NULL) { mutt_perror (tmpfname); @@ -1788,7 +1788,7 @@ static BODY *smime_handle_entity (BODY *m, STATE *s, FILE *outFile) if (outFile) fpout = outFile; else { - mutt_mktemp (tmptmpfname); + mutt_mktemp (tmptmpfname, sizeof (tmptmpfname)); if ((fpout = safe_fopen (tmptmpfname, "w+")) == NULL) { mutt_perror(tmptmpfname); @@ -1895,7 +1895,7 @@ int smime_decrypt_mime (FILE *fpin, FILE **fpout, BODY *b, BODY **cur) s.fpin = fpin; fseeko (s.fpin, b->offset, 0); - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if ((tmpfp = safe_fopen (tempfile, "w+")) == NULL) { mutt_perror (tempfile); @@ -1912,7 +1912,7 @@ int smime_decrypt_mime (FILE *fpin, FILE **fpout, BODY *b, BODY **cur) s.fpin = tmpfp; s.fpout = 0; - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if ((*fpout = safe_fopen (tempfile, "w+")) == NULL) { mutt_perror (tempfile);