[evolution-data-server/gnome-3-22] Bug 779886 - Add NULL checks to camel_content_type_set_param/camel_content_type_simple



commit 3231778139ff834fbb8a05cc1a543014b3234c6b
Author: Milan Crha <mcrha redhat com>
Date:   Mon Mar 13 09:40:15 2017 +0100

    Bug 779886 - Add NULL checks to camel_content_type_set_param/camel_content_type_simple

 camel/camel-mime-utils.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index c64f54f..e168ccc 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -2401,6 +2401,8 @@ camel_content_type_set_param (CamelContentType *t,
                               const gchar *name,
                               const gchar *value)
 {
+       g_return_if_fail (t != NULL);
+
        camel_header_set_param (&t->params, name, value);
 }
 
@@ -3725,6 +3727,9 @@ camel_content_type_format (CamelContentType *ct)
 gchar *
 camel_content_type_simple (CamelContentType *ct)
 {
+       if (!ct)
+               return NULL;
+
        if (ct->type == NULL) {
                w (g_warning ("Content-Type with no main type"));
                return g_strdup ("text/plain");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]