diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-01-04 22:17:52 +0000 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-01-04 22:17:52 +0000 |
commit | c36722172c428cf2017ad1ec84e38e22a8460286 (patch) | |
tree | e6ed210f18de4f1c858dc153ec3445c9cdf73c63 | |
parent | 8a51f88977f765e657742334a7ef96768b1d083e (diff) | |
download | evolution-data-server-c36722172c428cf2017ad1ec84e38e22a8460286.tar.gz |
Don't try setting a content-type parameter if either the name or value is
2001-12-12 Jeffrey Stedfast <fejj@ximian.com>
* camel-folder-summary.c (content_info_load): Don't try setting a
content-type parameter if either the name or value is NULL.
* camel-mime-utils.c (header_set_param): NULL-protection.
-rw-r--r-- | camel/ChangeLog | 7 | ||||
-rw-r--r-- | camel/camel-folder-summary.c | 7 | ||||
-rw-r--r-- | camel/camel-mime-utils.c | 5 |
3 files changed, 16 insertions, 3 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 7f2a7fd0f..1436f12a6 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2001-12-12 Jeffrey Stedfast <fejj@ximian.com> + + * camel-folder-summary.c (content_info_load): Don't try setting a + content-type parameter if either the name or value is NULL. + + * camel-mime-utils.c (header_set_param): NULL-protection. + 2001-12-17 Dan Winship <danw@ximian.com> * Makefile.am (INCLUDES): define CAMEL_PROVIDERDIR to be the diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c index 2591e868a..65fdc76cb 100644 --- a/camel/camel-folder-summary.c +++ b/camel/camel-folder-summary.c @@ -1768,11 +1768,14 @@ content_info_load(CamelFolderSummary *s, FILE *in) g_free(subtype); if (camel_file_util_decode_uint32(in, &count) == -1 || count > 500) goto error; - + for (i=0;i<count;i++) { char *name, *value; camel_folder_summary_decode_token(in, &name); camel_folder_summary_decode_token(in, &value); + if (!(name && value)) + goto error; + header_content_type_set_param(ct, name, value); /* TODO: do this so we dont have to double alloc/free */ g_free(name); @@ -1791,7 +1794,7 @@ content_info_load(CamelFolderSummary *s, FILE *in) if (!ferror(in)) return ci; -error: + error: camel_folder_summary_content_info_free(s, ci); return NULL; } diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c index 069804bd8..47e26bf78 100644 --- a/camel/camel-mime-utils.c +++ b/camel/camel-mime-utils.c @@ -2081,7 +2081,10 @@ struct _header_param * header_set_param (struct _header_param **l, const char *name, const char *value) { struct _header_param *p = (struct _header_param *)l, *pn; - + + if (name == NULL) + return NULL; + while (p->next) { pn = p->next; if (!strcasecmp (pn->name, name)) { |