aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-08-20 03:25:01 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-08-20 03:25:01 +0800
commit6dbfa6b0af78227963962a831875c4959180731d (patch)
treedcbda2aaba50f35cc865cd9cc28753b68286699b
parenta2b0fea02640e4aefa24788c5096a32d5743050f (diff)
downloadgsoc2013-evolution-6dbfa6b0af78227963962a831875c4959180731d.tar.gz
gsoc2013-evolution-6dbfa6b0af78227963962a831875c4959180731d.tar.zst
gsoc2013-evolution-6dbfa6b0af78227963962a831875c4959180731d.zip
Make sure the generated UID is non-NULL before appending it to the array
2001-08-19 Jeffrey Stedfast <fejj@ximian.com> * 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
-rw-r--r--camel/ChangeLog6
-rw-r--r--camel/camel-mime-utils.c2
-rw-r--r--camel/providers/pop3/camel-pop3-folder.c7
3 files changed, 9 insertions, 6 deletions
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 <fejj@ximian.com>
+
+ * 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 <fejj@ximian.com>
* 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;