diff options
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 5 | ||||
-rw-r--r-- | 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 <NotZed@Ximian.com> + + * em-format.c (emf_multipart_signed): check mps->protocol != NULL + before dereferencing it. See #54406. + 2004-02-20 Jeffrey Stedfast <fejj@ximian.com> * 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")); |