From 5f3714fd381f715abcffc898fb09b66bab036c7f Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Fri, 25 Nov 2011 12:52:55 -0800 Subject: [PATCH] Check that $sendmail is set to avoid potential segfault. Closes #3548. --- sendlib.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sendlib.c b/sendlib.c index 4daafaff..1ee7fb2b 100644 --- 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, " "))) -- 2.49.0