]> granicus.if.org Git - neomutt/commitdiff
Check that $sendmail is set to avoid potential segfault. Closes #3548.
authorMichael Elkins <me@mutt.org>
Fri, 25 Nov 2011 20:52:55 +0000 (12:52 -0800)
committerMichael Elkins <me@mutt.org>
Fri, 25 Nov 2011 20:52:55 +0000 (12:52 -0800)
sendlib.c

index 4daafaff05c674fed65f5c54ea7bfc9a9b689232..1ee7fb2b1f676f3253ab9e91d99b2d8bb99ff4ae 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -2344,6 +2344,13 @@ mutt_invoke_sendmail (ADDRESS *from,     /* the sender */
   size_t argslen = 0, argsmax = 0;
   int i;
 
+  /* ensure that $sendmail is set to avoid a crash. http://dev.mutt.org/trac/ticket/3548 */
+  if (!s)
+  {
+    mutt_error(_("$sendmail must be set in order to send mail."));
+    return -1;
+  }
+
   ps = s;
   i = 0;
   while ((ps = strtok (ps, " ")))