From 4d72695455d083a46404b3fd1eb65a3c7332f254 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 10 May 2017 13:27:40 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/server:mail/mutt?expand=0&rev=165 --- mutt-1.8.2-from4crypt.diff | 40 ++++++++++++++++++++++++++++++++++++++ mutt.changes | 5 +++++ mutt.spec | 3 +++ 3 files changed, 48 insertions(+) create mode 100644 mutt-1.8.2-from4crypt.diff diff --git a/mutt-1.8.2-from4crypt.diff b/mutt-1.8.2-from4crypt.diff new file mode 100644 index 0000000..c5f4aca --- /dev/null +++ b/mutt-1.8.2-from4crypt.diff @@ -0,0 +1,40 @@ +From 67061b07d357086d1a0526a3c53adfa32f72929f Mon Sep 17 00:00:00 2001 +From: Werner Fink +Subject: Fix crash if no from is set or found + +On multi folder mailbox setup and without a set +'From:' line in ~/.muttrc the mutt crash with SIGSEGV +on a NULL pointer at msg->env->from + +Signed-off-by: Werner Fink +--- + crypt.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +--- a/crypt.c ++++ b/crypt.c 2017-05-10 09:02:42.654128156 +0000 +@@ -179,12 +179,22 @@ int mutt_protect(HEADER *msg, char *keyl + + if (option(OPTCRYPTUSEPKA) && (msg->security & SIGN)) + { ++ const char *mailbox; ++ ADDRESS *from = msg->env->from; ++ ++ if (!from) ++ from = mutt_default_from(); ++ ++ mailbox = from->mailbox; ++ if (!mailbox && EnvFrom) ++ mailbox = EnvFrom->mailbox; ++ + /* Set sender (necessary for e.g. PKA). */ + + if ((WithCrypto & APPLICATION_SMIME) && (msg->security & APPLICATION_SMIME)) +- crypt_smime_set_sender(msg->env->from->mailbox); ++ crypt_smime_set_sender(mailbox); + else if ((WithCrypto & APPLICATION_PGP) && (msg->security & APPLICATION_PGP)) +- crypt_pgp_set_sender(msg->env->from->mailbox); ++ crypt_pgp_set_sender(mailbox); + } + + if (msg->security & SIGN) diff --git a/mutt.changes b/mutt.changes index f57fca7..c118715 100644 --- a/mutt.changes +++ b/mutt.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed May 10 08:55:37 UTC 2017 - werner@suse.de + +- Fix crash in crypt.c if no From is found or set + ------------------------------------------------------------------- Mon May 1 16:06:58 UTC 2017 - werner@suse.de diff --git a/mutt.spec b/mutt.spec index 833ff7d..3c5ef4b 100644 --- a/mutt.spec +++ b/mutt.spec @@ -113,6 +113,8 @@ Patch16: mutt-1.5.23-carriage-return.path Patch18: mutt-1.5.21-mailcap.diff # PATCH-FIX-SUSE: bsc#907453 - CVE-2014-9116: mutt: heap-based buffer overflow in mutt_substrdup() Patch19: bsc907453-CVE-2014-9116-jessie.patch +# PATCH-FIX-SUSE: Fix crash in crypt routines if no from is set or found +Patch20: mutt-1.8.2-from4crypt.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir %{_sysconfdir} @@ -158,6 +160,7 @@ ln -sf neomutt-neomutt-%neo mutt-%version %patch16 -p0 -b .crlf %patch18 -p0 -b .mailcap %patch19 -p0 -b .cvw2014.9116 +%patch20 -p0 -b .from4crypt rm -vf README*.orig rm -vf PATCHES*.orig