From: Liu Yuan <tailai.ly at taobao.com> The calculation for max_logs is wrong and this would result in Segmentatoin Fault when querying cluster epoch information by 'collie cluster info' Reported-by: Shawn Moore <smmoore at gmail.com> Signed-off-by: Liu Yuan <tailai.ly at taobao.com> --- sheep/group.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/sheep/group.c b/sheep/group.c index ee12cf3..9af64b6 100644 --- a/sheep/group.c +++ b/sheep/group.c @@ -266,7 +266,7 @@ void cluster_queue_request(struct work *work, int idx) (struct sd_node_rsp *)rsp, req->data); break; case SD_OP_STAT_CLUSTER: - max_logs = rsp->data_length / sizeof(log->nodes[0]); + max_logs = rsp->data_length / sizeof(*log); epoch = get_latest_epoch(); rsp->data_length = 0; for (i = 0; i < max_logs; i++) { -- 1.7.5.1 |