diff options
Diffstat (limited to 'camel/camel-folder-summary.c')
-rw-r--r-- | camel/camel-folder-summary.c | 70 |
1 files changed, 28 insertions, 42 deletions
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c index 82571e7632..ebef730c70 100644 --- a/camel/camel-folder-summary.c +++ b/camel/camel-folder-summary.c @@ -1693,66 +1693,52 @@ message_info_load(CamelFolderSummary *s, FILE *in) #endif mi->content = NULL; - - /* decode the message-id */ - if (camel_file_util_decode_fixed_int32 (in, &mi->message_id.id.part.hi) == -1) - goto error; - if (camel_file_util_decode_fixed_int32 (in, &mi->message_id.id.part.lo) == -1) - goto error; - - /* decode the references count */ - if (camel_file_util_decode_uint32 (in, &count) == -1 || count > 500) + + camel_file_util_decode_fixed_int32(in, &mi->message_id.id.part.hi); + camel_file_util_decode_fixed_int32(in, &mi->message_id.id.part.lo); + + if (camel_file_util_decode_uint32(in, &count) == -1 || count > 500) goto error; - + if (count > 0) { - /* decode the references */ mi->references = g_malloc(sizeof(*mi->references) + ((count-1) * sizeof(mi->references->references[0]))); mi->references->size = count; - for (i = 0; i < count; i++) { - if (camel_file_util_decode_fixed_int32 (in, &mi->references->references[i].id.part.hi) == -1) - goto error; - if (camel_file_util_decode_fixed_int32 (in, &mi->references->references[i].id.part.lo) == -1) - goto error; + for (i=0;i<count;i++) { + camel_file_util_decode_fixed_int32(in, &mi->references->references[i].id.part.hi); + camel_file_util_decode_fixed_int32(in, &mi->references->references[i].id.part.lo); } } - - if (camel_file_util_decode_uint32 (in, &count) == -1 || count > 500) + + if (camel_file_util_decode_uint32(in, &count) == -1 || count > 500) goto error; - - /* decode the user-flags */ - for (i = 0; i < count; i++) { + + for (i=0;i<count;i++) { char *name; - - if (camel_file_util_decode_string (in, &name) == -1) + if (camel_file_util_decode_string(in, &name) == -1 || name == NULL) goto error; - - camel_flag_set (&mi->user_flags, name, TRUE); - g_free (name); + camel_flag_set(&mi->user_flags, name, TRUE); + g_free(name); } - - if (camel_file_util_decode_uint32 (in, &count) == -1 || count > 500) + + if (camel_file_util_decode_uint32(in, &count) == -1 || count > 500) goto error; - - /* decode the user-tags */ - for (i = 0; i < count; i++) { + + for (i=0;i<count;i++) { char *name, *value; - - if (camel_file_util_decode_string (in, &name) == -1) - goto error; - if (camel_file_util_decode_string (in, &value) == -1) + if (camel_file_util_decode_string(in, &name) == -1 || name == NULL + || camel_file_util_decode_string(in, &value) == -1) goto error; - - camel_tag_set (&mi->user_tags, name, value); - g_free (name); - g_free (value); + camel_tag_set(&mi->user_tags, name, value); + g_free(name); + g_free(value); } - + if (!ferror(in)) return mi; - + error: camel_folder_summary_info_free(s, mi); - + return NULL; } |