From f6d01c691983d382d8bc33cbe3f34f8345995a88 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Mon, 23 Feb 2004 13:47:21 +0000 Subject: check mps->protocol != NULL before dereferencing it. See #54406. 2004-02-23 Not Zed * em-format.c (emf_multipart_signed): check mps->protocol != NULL before dereferencing it. See #54406. svn path=/trunk/; revision=24829 --- mail/ChangeLog | 5 +++++ mail/em-format.c | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 284e5a6e95..ec9e01593a 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,8 @@ +2004-02-23 Not Zed + + * em-format.c (emf_multipart_signed): check mps->protocol != NULL + before dereferencing it. See #54406. + 2004-02-20 Jeffrey Stedfast * em-folder-view.c (emfv_list_key_press): Delete key should always diff --git a/mail/em-format.c b/mail/em-format.c index c3194566d2..e107e39db4 100644 --- a/mail/em-format.c +++ b/mail/em-format.c @@ -1299,14 +1299,16 @@ emf_multipart_signed(EMFormat *emf, CamelStream *stream, CamelMimePart *part, co /* FIXME: Should be done via a plugin interface */ /* FIXME: duplicated in em-format-html-display.c */ + if (mps->protocol) { #ifdef ENABLE_SMIME - if (g_ascii_strcasecmp("application/x-pkcs7-signature", mps->protocol) == 0 - || g_ascii_strcasecmp("application/pkcs7-signature", mps->protocol) == 0) - cipher = camel_smime_context_new(emf->session); - else + if (g_ascii_strcasecmp("application/x-pkcs7-signature", mps->protocol) == 0 + || g_ascii_strcasecmp("application/pkcs7-signature", mps->protocol) == 0) + cipher = camel_smime_context_new(emf->session); + else #endif - if (g_ascii_strcasecmp("application/pgp-signature", mps->protocol) == 0) - cipher = camel_gpg_context_new(emf->session); + if (g_ascii_strcasecmp("application/pgp-signature", mps->protocol) == 0) + cipher = camel_gpg_context_new(emf->session); + } if (cipher == NULL) { em_format_format_error(emf, stream, _("Unsupported signature format")); -- cgit