[sheepdog] [PATCH stable-0.9 6/7] dog: referencing uninitialized buffer during cluster format

Hitoshi Mitake mitake.hitoshi at lab.ntt.co.jp
Fri Dec 26 05:41:31 CET 2014


From: Saeki Masaki <saeki.masaki at po.ntts.co.jp>

when executing dog cluster format,
by referring to the memory area that is not initialized
update_node_list() was an unintended behavior.

Signed-off-by: Masaki Saeki <saeki.masaki at po.ntts.co.jp>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
---
 dog/dog.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dog/dog.c b/dog/dog.c
index 3f33cdd..54520dd 100644
--- a/dog/dog.c
+++ b/dog/dog.c
@@ -118,6 +118,7 @@ int update_node_list(int max_nodes)
 	/* check whether cluster use diskmode */
 	log_length = sizeof(struct epoch_log);
 	logs = xmalloc(log_length);
+	memset(logs, 0, log_length);
 
 	sd_init_req(&hdr, SD_OP_STAT_CLUSTER);
 	hdr.data_length = log_length;
-- 
1.8.3.2




More information about the sheepdog mailing list