From 1d8c2ddc164c6b4c90f58310b385655ccdd98667 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Thu, 29 Jan 2004 08:54:15 +0000 Subject: ** See bug #53269. 2004-01-29 Not Zed ** See bug #53269. * providers/nntp/camel-nntp-store.c (nntp_store_get_cached_folder_info): don't dereference last before checking if its null. svn path=/trunk/; revision=24514 --- camel/ChangeLog | 6 ++++++ camel/providers/nntp/camel-nntp-store.c | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index b5ad5d1ceb..b828328a7d 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,11 @@ 2004-01-29 Not Zed + ** See bug #53269. + + * providers/nntp/camel-nntp-store.c + (nntp_store_get_cached_folder_info): don't dereference last before + checking if its null. + * camel-object.c (camel_object_bag_rekey): added a doc comment. ** See bug #53520. diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c index a439c4fd8a..77fbd59fe8 100644 --- a/camel/providers/nntp/camel-nntp-store.c +++ b/camel/providers/nntp/camel-nntp-store.c @@ -496,7 +496,7 @@ nntp_store_get_subscribed_folder_info (CamelNNTPStore *store, const char *top, g static CamelFolderInfo * nntp_store_get_cached_folder_info (CamelNNTPStore *store, const char *orig_top, guint flags, CamelException *ex) { - int len, i; + int i; int subscribed_or_flag = (flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED) ? 0 : 1, root_or_flag = (orig_top == NULL || orig_top[0] == '\0') ? 1 : 0, recursive_flag = flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE; @@ -522,10 +522,9 @@ nntp_store_get_cached_folder_info (CamelNNTPStore *store, const char *orig_top, /* apparently, this is an indirect subitem. if it's not a subitem of the item we added last, we need to add a portion of this item to the list as a placeholder */ - len = strlen (last->full_name); if (!last || - g_ascii_strncasecmp(si->path, last->full_name, len) != 0 || - si->path[len] != '.') { + g_ascii_strncasecmp(si->path, last->full_name, strlen(last->full_name)) != 0 || + si->path[strlen(last->full_name)] != '.') { tmpname = g_strdup(si->path); *(strchr(tmpname + toplen, '.')) = '\0'; fi = nntp_folder_info_from_name(store, FALSE, tmpname); -- cgit v1.2.3