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



commit cab838ae34d7b413f92b2dc7227a26d7aeb5127d
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

 src/camel/camel-mime-utils.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/camel/camel-mime-utils.c b/src/camel/camel-mime-utils.c
index 641d8ab..8dad8c2 100644
--- a/src/camel/camel-mime-utils.c
+++ b/src/camel/camel-mime-utils.c
@@ -2400,6 +2400,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);
 }
 
@@ -3726,6 +3728,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]