public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: RHEL5 - clogd: Initialize list structs before adding to list.
@ 2009-02-11 15:57 Jonathan Brassow
0 siblings, 0 replies; only message in thread
From: Jonathan Brassow @ 2009-02-11 15:57 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=948e49365049e7540d5c5702c1885ff8f1887619
Commit: 948e49365049e7540d5c5702c1885ff8f1887619
Parent: 864eb5eb988f9036759f58d651754ec0831675d5
Author: Jonathan Brassow <jbrassow@redhat.com>
AuthorDate: Wed Feb 11 09:56:28 2009 -0600
Committer: Jonathan Brassow <jbrassow@redhat.com>
CommitterDate: Wed Feb 11 09:56:28 2009 -0600
clogd: Initialize list structs before adding to list.
If we don't initialize newly allocated list structures,
we can corrupt the working linked list.
---
cmirror/src/cluster.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/cmirror/src/cluster.c b/cmirror/src/cluster.c
index 483ed1d..7711b28 100644
--- a/cmirror/src/cluster.c
+++ b/cmirror/src/cluster.c
@@ -927,6 +927,7 @@ static void cpg_message_callback(cpg_handle_t handle, struct cpg_name *gname,
return;
}
memcpy(tmp_tfr, tfr, sizeof(*tfr) + tfr->data_size);
+ INIT_LIST_HEAD((struct list_head *)&tmp_tfr->private);
list_add_tail((struct list_head *)&tmp_tfr->private, &match->working_list);
}
@@ -1023,6 +1024,7 @@ static void cpg_message_callback(cpg_handle_t handle, struct cpg_name *gname,
memcpy(tmp_tfr, tfr, sizeof(*tfr) + tfr->data_size);
tmp_tfr->error = match->lowest_id;
+ INIT_LIST_HEAD((struct list_head *)&tmp_tfr->private);
list_add_tail((struct list_head *)&tmp_tfr->private,
&match->startup_list);
goto out;
@@ -1146,6 +1148,7 @@ static void cpg_join_callback(struct clog_cpg *match,
}
tfr->request_type = DM_CLOG_MEMBER_JOIN;
tfr->originator = joined->nodeid;
+ INIT_LIST_HEAD((struct list_head *)&tfr->private);
list_add_tail((struct list_head *)&tfr->private, &match->startup_list);
out:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-02-11 15:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-11 15:57 cluster: RHEL5 - clogd: Initialize list structs before adding to list Jonathan Brassow
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).