From 6dbfa6b0af78227963962a831875c4959180731d Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Sun, 19 Aug 2001 19:25:01 +0000 Subject: Make sure the generated UID is non-NULL before appending it to the array 2001-08-19 Jeffrey Stedfast * providers/pop3/camel-pop3-folder.c (pop3_generate_uids): Make sure the generated UID is non-NULL before appending it to the array of UIDs. How would this even happen? I have no clue... svn path=/trunk/; revision=12225 --- camel/ChangeLog | 6 ++++++ camel/camel-mime-utils.c | 2 +- camel/providers/pop3/camel-pop3-folder.c | 7 ++----- 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index 7c89991299..0524a1fef5 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2001-08-19 Jeffrey Stedfast + + * providers/pop3/camel-pop3-folder.c (pop3_generate_uids): Make + sure the generated UID is non-NULL before appending it to the + array of UIDs. How would this even happen? I have no clue... + 2001-08-17 Jeffrey Stedfast * providers/imap/camel-imap-folder.c (imap_update_summary): Start diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c index c30c4d79ba..a6488c231b 100644 --- a/camel/camel-mime-utils.c +++ b/camel/camel-mime-utils.c @@ -472,7 +472,7 @@ base64_encode_simple (const char *data, int len) unsigned char *out; int state = 0, outlen; unsigned int save = 0; - + out = g_malloc (len * 4 / 3 + 5); outlen = base64_encode_close ((unsigned char *)data, len, FALSE, out, &state, &save); diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c index bb6b0f9171..f9f53c7e57 100644 --- a/camel/providers/pop3/camel-pop3-folder.c +++ b/camel/providers/pop3/camel-pop3-folder.c @@ -144,10 +144,6 @@ camel_pop3_folder_new (CamelStore *parent, CamelException *ex) static GPtrArray * pop3_generate_uids (CamelFolder *folder, int count, CamelException *ex) { - /* FIXME: This is extremely inefficient but there's no way - around it. Because of that, perhaps we should have some way - of caching these messages so we don't have to download them - a second time for this session? */ GPtrArray *uids; int i; @@ -167,7 +163,8 @@ pop3_generate_uids (CamelFolder *folder, int count, CamelException *ex) camel_object_unref (CAMEL_OBJECT (stream)); uid = base64_encode_simple (digest, 16); - g_ptr_array_add (uids, uid); + if (uid && *uid) + g_ptr_array_add (uids, uid); } return uids; -- cgit v1.2.3