[sheepdog] [PATCH stable-0.7] recovery: initialize recovery_state

Hitoshi Mitake mitake.hitoshi at gmail.com
Tue Aug 20 17:49:28 CEST 2013


From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>

This prevents dog from reading uninitialize data and fixes a valgrind
error of functional tests.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 sheep/recovery.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sheep/recovery.c b/sheep/recovery.c
index 1b5adc1..e734b88 100644
--- a/sheep/recovery.c
+++ b/sheep/recovery.c
@@ -872,6 +872,8 @@ void get_recovery_state(struct recovery_state *state)
 {
 	struct recovery_info *rinfo = main_thread_get(current_rinfo);
 
+	memset(state, 0, sizeof(*state));
+
 	if (!rinfo) {
 		state->in_recovery = 0;
 		return;
-- 
1.8.1.2




More information about the sheepdog mailing list