[sheepdog] [PATCH] sheep: fix a bug of segment fault caused by unintialized list_head

levin li levin108 at gmail.com
Tue Jun 26 11:27:01 CEST 2012


From: levin li <xingke.lwp at taobao.com>

client_info.conn.blocking_siblings is initialized with INIT_LIST_HEAD, but
we check whether it's empty as a list head in client_handler, with
an uninitialized list_head, it may not empty, so list_del gives a
segment fault.

Signed-off-by: levin li <xingke.lwp at taobao.com>
---
 sheep/sdnet.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/sheep/sdnet.c b/sheep/sdnet.c
index 7178e9e..978c8d0 100644
--- a/sheep/sdnet.c
+++ b/sheep/sdnet.c
@@ -655,6 +655,7 @@ static struct client_info *create_client(int fd, struct cluster_info *cluster)
 	ci->refcnt = 1;
 
 	INIT_LIST_HEAD(&ci->done_reqs);
+	INIT_LIST_HEAD(&ci->conn.blocking_siblings);
 
 	init_rx_hdr(ci);
 
-- 
1.7.10




More information about the sheepdog mailing list