From 7fe3d3fe2b0bec8085b15fb4d9db8fdead826d57 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Sat, 20 Aug 2011 15:18:09 +0530 Subject: libglusterfs: Fix a crash in gluster volume set help Change-Id: I585e8e685f5c23b6fa632ef708adf2e349ba6704 BUG: 3415 Reviewed-on: http://review.gluster.com/274 Reviewed-by: Raghavendra Bhat Tested-by: Gluster Build System --- libglusterfs/src/options.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libglusterfs/src/options.c') diff --git a/libglusterfs/src/options.c b/libglusterfs/src/options.c index dee3c9185..ccd57e4f0 100644 --- a/libglusterfs/src/options.c +++ b/libglusterfs/src/options.c @@ -567,12 +567,19 @@ static volume_option_t * xlator_volume_option_get_list (volume_opt_list_t *vol_list, const char *key) { volume_option_t *opt = NULL; + volume_opt_list_t *opt_list = NULL; volume_option_t *found = NULL; int index = 0; int i = 0; char *cmp_key = NULL; - opt = vol_list->given_opt; + if (!vol_list->given_opt) { + opt_list = list_entry (vol_list->list.next, volume_opt_list_t, + list); + opt = opt_list->given_opt; + } else + opt = vol_list->given_opt; + for (index = 0; opt[index].key && opt[index].key[0]; index++) { for (i = 0; i < ZR_VOLUME_MAX_NUM_KEY; i++) { cmp_key = opt[index].key[i]; -- cgit