[sheepdog] [PATCH] sheep: fix missing trailing '\0' in the store list string

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Sun May 20 16:27:33 CEST 2012


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/ops.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sheep/ops.c b/sheep/ops.c
index 1b35552..ec86eae 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -312,7 +312,7 @@ static int local_get_store_list(struct request *req)
 	list_for_each_entry(driver, &store_drivers, list) {
 		strbuf_addf(&buf, "%s ", driver->name);
 	}
-	memcpy(req->data, buf.buf, buf.len);
+	memcpy(req->data, buf.buf, buf.len + 1);
 
 	strbuf_release(&buf);
 	return SD_RES_SUCCESS;
-- 
1.7.2.5




More information about the sheepdog mailing list