aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-11-13 07:23:51 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-11-13 07:23:51 +0800
commit10752c7a830ae7ac3a5ddad9192c3f464a281c4e (patch)
tree7403ea543d034d6cc83a4ebe7395c4b5df8c65f2 /mail
parente42b0f20616d6fa2721389b207da9e36cc4c196e (diff)
downloadgsoc2013-evolution-10752c7a830ae7ac3a5ddad9192c3f464a281c4e.tar
gsoc2013-evolution-10752c7a830ae7ac3a5ddad9192c3f464a281c4e.tar.gz
gsoc2013-evolution-10752c7a830ae7ac3a5ddad9192c3f464a281c4e.tar.bz2
gsoc2013-evolution-10752c7a830ae7ac3a5ddad9192c3f464a281c4e.tar.lz
gsoc2013-evolution-10752c7a830ae7ac3a5ddad9192c3f464a281c4e.tar.xz
gsoc2013-evolution-10752c7a830ae7ac3a5ddad9192c3f464a281c4e.tar.zst
gsoc2013-evolution-10752c7a830ae7ac3a5ddad9192c3f464a281c4e.zip
Add a NULL check for rule->name. (mail_vfolder_add_uri): Same here.
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. svn path=/trunk/; revision=14677
Diffstat (limited to 'mail')
-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);