aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/mail-vfolder.c20
2 files changed, 20 insertions, 6 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 00b15aef6e..8e5da872b7 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,9 @@
+2001-11-12 Jeffrey Stedfast <fejj@ximian.com>
+
+ * mail-vfolder.c (vfolder_load_storage): Add a NULL check for
+ rule->name.
+ (mail_vfolder_add_uri): Same here.
+
2001-11-09 Jeffrey Stedfast <fejj@ximian.com>
* mail-callbacks.c (forward_message): If we already have the
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index c6e0dbac2b..c8788239a5 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -337,20 +337,25 @@ mail_vfolder_add_uri(CamelStore *store, const char *uri, int remove)
}
rule = NULL;
- while ( (rule = rule_context_next_rule((RuleContext *)context, rule, NULL)) ) {
+ while ((rule = rule_context_next_rule((RuleContext *)context, rule, NULL))) {
int found = FALSE;
-
+
+ if (!rule->name) {
+ d(printf ("invalid rule (%p): rule->name is set to NULL\n"));
+ continue;
+ }
+
if (rule->source
&& ((!strcmp(rule->source, "local") && !remote)
|| (!strcmp(rule->source, "remote_active") && remote)
|| (!strcmp(rule->source, "local_remote_active"))))
found = TRUE;
-
+
/* we check using the store uri_cmp since its more accurate */
source = NULL;
- while ( !found && (source = vfolder_rule_next_source((VfolderRule *)rule, source)) )
+ while (!found && (source = vfolder_rule_next_source((VfolderRule *)rule, source)))
found = uri_cmp(uri, source);
-
+
if (found) {
vf = g_hash_table_lookup(vfolder_hash, rule->name);
g_assert(vf);
@@ -736,7 +741,10 @@ vfolder_load_storage(GNOME_Evolution_Shell shell)
/* and setup the rules we have */
rule = NULL;
while ( (rule = rule_context_next_rule((RuleContext *)context, rule, NULL)) ) {
- context_rule_added((RuleContext *)context, rule);
+ if (rule->name)
+ context_rule_added((RuleContext *)context, rule);
+ else
+ d(printf ("invalid rule (%p) encountered: rule->name is NULL\n"));
}
g_free(storeuri);