aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-format.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-02-23 05:40:26 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-02-23 05:40:26 +0800
commite939da9df48b7e4992de4df915e7832803f8fa12 (patch)
tree2baa5274b6b5601a6560bde5d15f0d7faf6d956b /mail/mail-format.c
parent09515df40565b84e1fdcafce80015b51c0984567 (diff)
downloadgsoc2013-evolution-e939da9df48b7e4992de4df915e7832803f8fa12.tar.gz
gsoc2013-evolution-e939da9df48b7e4992de4df915e7832803f8fa12.tar.zst
gsoc2013-evolution-e939da9df48b7e4992de4df915e7832803f8fa12.zip
Fixed memory corruption bug.
2001-02-22 Jeffrey Stedfast <fejj@ximian.com> * openpgp-utils.c (openpgp_verify): Fixed memory corruption bug. * mail-format.c (try_inline_pgp_sig): Check to make sure the validity isn't NULL. (handle_multipart_signed): Check for NULL validities. 2001-02-21 Jeffrey Stedfast <fejj@ximian.com> * mail-tools.c (mail_tool_uri_to_folder): Protect against NULL uri's. * mail-vtrash.c: Do mutex locking on the global hash table - this should clear up some segfaults ;-) * mail-config-druid.c (druid_finish): Set the 'enabled' member of the source to TRUE if the URL exists else set to FALSE. (incoming_type_changed): If the provider chosen is "None" then gray-out the auto-check widgets and the check-settings, otherwise sensitize them. * mail-account-editor.c (construct): Added a few more settings. (apply_changes): Save the new settings. * mail-config.c (service_copy): Updated. (config_read): Read in whether or not the account is enabled. (mail_config_write): Save if the account is enabled or not. svn path=/trunk/; revision=8349
Diffstat (limited to 'mail/mail-format.c')
-rw-r--r--mail/mail-format.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/mail/mail-format.c b/mail/mail-format.c
index 7517ac95bd..27849d54b7 100644
--- a/mail/mail-format.c
+++ b/mail/mail-format.c
@@ -119,7 +119,7 @@ add_url (char *url, gpointer data, MailDisplay *md)
urls = g_datalist_get_data (md->data, "urls");
g_return_val_if_fail (urls != NULL, NULL);
-
+
if (g_hash_table_lookup_extended (urls, url, &old_key, &old_value)) {
g_free (url);
url = old_key;
@@ -1010,7 +1010,7 @@ try_inline_pgp_sig (char *start, MailDisplay *md)
g_free (plaintext);
/* Now display the "seal-of-authenticity" or something... */
- if (openpgp_validity_get_valid (valid)) {
+ if (valid && openpgp_validity_get_valid (valid)) {
mail_html_write (md->html, md->stream,
"<hr>\n<table><tr valign=top>"
"<td><img src=\"%s\"></td>"
@@ -1028,7 +1028,7 @@ try_inline_pgp_sig (char *start, MailDisplay *md)
"not be proven to be authentic."));
}
- if (openpgp_validity_get_description (valid)) {
+ if (valid && openpgp_validity_get_description (valid)) {
mail_error_write (md->html, md->stream,
openpgp_validity_get_description (valid));
mail_html_write (md->html, md->stream, "<br><br>");
@@ -1339,6 +1339,7 @@ handle_multipart_encrypted (CamelMimePart *part, const char *mime_type,
CamelException ex;
wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
+
g_return_val_if_fail (CAMEL_IS_MULTIPART (wrapper), FALSE);
/* Currently we only handle RFC2015-style PGP encryption. */
@@ -1372,6 +1373,7 @@ handle_multipart_signed (CamelMimePart *part, const char *mime_type,
int nparts, i;
wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
+
g_return_val_if_fail (CAMEL_IS_MULTIPART (wrapper), FALSE);
/* Currently we only handle RFC2015-style PGP signatures. */
@@ -1395,7 +1397,7 @@ handle_multipart_signed (CamelMimePart *part, const char *mime_type,
}
/* Now display the "seal-of-authenticity" or something... */
- if (openpgp_validity_get_valid (valid)) {
+ if (valid && openpgp_validity_get_valid (valid)) {
mail_html_write (md->html, md->stream,
"<hr>\n<table><tr valign=top>"
"<td><img src=\"%s\"></td>"
@@ -1413,7 +1415,7 @@ handle_multipart_signed (CamelMimePart *part, const char *mime_type,
"not be proven to be authentic."));
}
- if (openpgp_validity_get_description (valid)) {
+ if (valid && openpgp_validity_get_description (valid)) {
mail_error_write (md->html, md->stream,
openpgp_validity_get_description (valid));
mail_html_write (md->html, md->stream, "<br><br>");
@@ -1441,6 +1443,7 @@ handle_multipart_related (CamelMimePart *part, const char *mime_type,
int i, nparts;
g_return_val_if_fail (CAMEL_IS_MULTIPART (wrapper), FALSE);
+
mp = CAMEL_MULTIPART (wrapper);
nparts = camel_multipart_get_number (mp);
@@ -1523,10 +1526,11 @@ handle_multipart_alternative (CamelMimePart *part, const char *mime_type,
camel_medium_get_content_object (CAMEL_MEDIUM (part));
CamelMultipart *multipart;
CamelMimePart *mime_part;
-
+
g_return_val_if_fail (CAMEL_IS_MULTIPART (wrapper), FALSE);
+
multipart = CAMEL_MULTIPART (wrapper);
-
+
mime_part = find_preferred_alternative (multipart, FALSE);
if (mime_part)
return call_handler_function (mime_part, md);
@@ -1544,6 +1548,7 @@ handle_multipart_appledouble (CamelMimePart *part, const char *mime_type,
CamelMultipart *multipart;
g_return_val_if_fail (CAMEL_IS_MULTIPART (wrapper), FALSE);
+
multipart = CAMEL_MULTIPART (wrapper);
/* The first part is application/applefile and is not useful
@@ -1560,9 +1565,9 @@ handle_message_rfc822 (CamelMimePart *part, const char *mime_type,
{
CamelDataWrapper *wrapper =
camel_medium_get_content_object (CAMEL_MEDIUM (part));
-
+
g_return_val_if_fail (CAMEL_IS_MIME_MESSAGE (wrapper), FALSE);
-
+
mail_html_write (md->html, md->stream, "<blockquote>");
mail_format_mime_message (CAMEL_MIME_MESSAGE (wrapper), md);
mail_html_write (md->html, md->stream, "</blockquote>");