]> granicus.if.org Git - neomutt/commitdiff
check retval of strtok()
authorRichard Russon <rich@flatcap.org>
Mon, 13 Nov 2017 01:57:37 +0000 (01:57 +0000)
committerRichard Russon <rich@flatcap.org>
Wed, 15 Nov 2017 15:12:11 +0000 (15:12 +0000)
sendlib.c

index 2d895e215c502aef894bd4e02aef5d10dc2b7e55..b87634b7c17bdcf262187976be8635762790d7c7 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -2942,6 +2942,9 @@ int mutt_write_multiple_fcc(const char *path, struct Header *hdr, const char *ms
   strfcpy(fcc_tok, path, sizeof(fcc_tok));
 
   tok = strtok(fcc_tok, ",");
+  if (!tok)
+    return -1;
+
   mutt_debug(1, "Fcc: initial mailbox = '%s'\n", tok);
   /* mutt_expand_path already called above for the first token */
   status = mutt_write_fcc(tok, hdr, msgid, post, fcc, finalpath);