[sheepdog] [PATCH] dog: referencing uninitialized buffer during cluster format

Saeki Masaki saeki.masaki at po.ntts.co.jp
Wed Dec 10 02:06:43 CET 2014


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>
---
 dog/dog.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

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.7.1





More information about the sheepdog mailing list