1
0
forked from pool/mutt
Dr. Werner Fink 2017-05-10 13:27:40 +00:00 committed by Git OBS Bridge
parent 17cbbe14ce
commit 4d72695455
3 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,40 @@
From 67061b07d357086d1a0526a3c53adfa32f72929f Mon Sep 17 00:00:00 2001
From: Werner Fink <werner@suse.de>
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 <werner@suse.de>
---
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)

View File

@ -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

View File

@ -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