aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-02-23 21:47:21 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-02-23 21:47:21 +0800
commitf6d01c691983d382d8bc33cbe3f34f8345995a88 (patch)
tree7fa982541aa0abe077b08f7b34b58ff814ae1f39 /mail/em-format.c
parentcc5c9897d1e987a90474491a9c94ba7d2b2bc5bc (diff)
downloadgsoc2013-evolution-f6d01c691983d382d8bc33cbe3f34f8345995a88.tar.gz
gsoc2013-evolution-f6d01c691983d382d8bc33cbe3f34f8345995a88.tar.zst
gsoc2013-evolution-f6d01c691983d382d8bc33cbe3f34f8345995a88.zip
check mps->protocol != NULL before dereferencing it. See #54406.
2004-02-23 Not Zed <NotZed@Ximian.com> * em-format.c (emf_multipart_signed): check mps->protocol != NULL before dereferencing it. See #54406. svn path=/trunk/; revision=24829
Diffstat (limited to 'mail/em-format.c')
-rw-r--r--mail/em-format.c14
1 files changed, 8 insertions, 6 deletions
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"));