From bf9f71b87f94b83e3999e63ddf96b0c149c5c754 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Thu, 20 Oct 2005 16:48:27 +0000 Subject: [PATCH] 2005-10-20 [colin] 1.9.15cvs81 * src/imap.c * src/etpan/imap-thread.c Fix possible crash. --- ChangeLog-gtk2.claws | 6 ++++++ PATCHSETS | 1 + configure.ac | 2 +- src/etpan/imap-thread.c | 5 ++++- src/imap.c | 5 +++++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog-gtk2.claws b/ChangeLog-gtk2.claws index d8b527c59..bbd3d429f 100644 --- a/ChangeLog-gtk2.claws +++ b/ChangeLog-gtk2.claws @@ -1,3 +1,9 @@ +2005-10-20 [colin] 1.9.15cvs81 + + * src/imap.c + * src/etpan/imap-thread.c + Fix possible crash. + 2005-10-20 [paul] 1.9.15cvs80 * src/folder.c diff --git a/PATCHSETS b/PATCHSETS index 2836f6a2f..2285cc8b7 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -917,3 +917,4 @@ ( cvs diff -u -r 1.1.2.27 -r 1.1.2.28 src/plugins/pgpmime/pgpmime.c; ) > 1.9.15cvs78.patchset ( cvs diff -u -r 1.100.2.27 -r 1.100.2.28 AUTHORS; cvs diff -u -r 1.1.2.28 -r 1.1.2.29 src/plugins/pgpmime/pgpmime.c; ) > 1.9.15cvs79.patchset ( cvs diff -u -r 1.213.2.65 -r 1.213.2.66 src/folder.c; ) > 1.9.15cvs80.patchset +( cvs diff -u -r 1.179.2.80 -r 1.179.2.81 src/imap.c; cvs diff -u -r 1.1.4.23 -r 1.1.4.24 src/etpan/imap-thread.c; ) > 1.9.15cvs81.patchset diff --git a/configure.ac b/configure.ac index 972e3933a..d69d2b7cd 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=15 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=80 +EXTRA_VERSION=81 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/etpan/imap-thread.c b/src/etpan/imap-thread.c index d491a210c..9b7a122df 100644 --- a/src/etpan/imap-thread.c +++ b/src/etpan/imap-thread.c @@ -1723,6 +1723,8 @@ fetch_to_env_info(struct mailimap_msg_att * msg_att) imap_get_msg_att_info(msg_att, &uid, &headers, &size, &att_dyn); + if (!headers) + return NULL; info = malloc(sizeof(* info)); info->uid = uid; info->headers = strdup(headers); @@ -1739,7 +1741,6 @@ imap_fetch_result_to_envelop_list(clist * fetch_result, clistiter * cur; unsigned int i; carray * env_list; - i = 0; env_list = carray_new(16); @@ -1752,6 +1753,8 @@ imap_fetch_result_to_envelop_list(clist * fetch_result, msg_att = clist_content(cur); env_info = fetch_to_env_info(msg_att); + if (!env_info) + return MAILIMAP_ERROR_MEMORY; carray_add(env_list, env_info, NULL); } diff --git a/src/imap.c b/src/imap.c index 92ba6f0c7..1052c6389 100644 --- a/src/imap.c +++ b/src/imap.c @@ -2027,6 +2027,8 @@ static void *imap_get_uncached_messages_thread(void *data) info = carray_get(env_list, i); msginfo = imap_envelope_from_lep(info, item); + if (msginfo == NULL) + continue; msginfo->folder = item; if (!newlist) llast = newlist = g_slist_append(newlist, msginfo); @@ -4117,6 +4119,9 @@ static MsgInfo *imap_envelope_from_lep(struct imap_fetch_env_info * info, size_t size = 0; MsgFlags flags = {0, 0}; + if (info->headers == NULL) + return NULL; + MSG_SET_TMP_FLAGS(flags, MSG_IMAP); if (folder_has_parent_of_type(item, F_QUEUE)) { MSG_SET_TMP_FLAGS(flags, MSG_QUEUED); -- 2.25.1