summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-parser.c
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2011-09-16 15:03:32 +0530
committerVijay Bellur <vijay@gluster.com>2011-09-18 22:04:00 -0700
commit16a4d4352c762f6035e1a39f619d358ba7688502 (patch)
tree98a3b77160b1f085c585f3bd4640d3ca12b379d7 /cli/src/cli-cmd-parser.c
parent4ee093305a0237368118e425723792a028b02a94 (diff)
cli: if the create volume command does not contain bricks, exit gracefully
Change-Id: I41f896d5a9c514994874b6e4e956d38fed742d4b BUG: 3571 Reviewed-on: http://review.gluster.com/438 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
Diffstat (limited to 'cli/src/cli-cmd-parser.c')
-rw-r--r--cli/src/cli-cmd-parser.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 8ea6581aff8..92626df76b5 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -320,6 +320,11 @@ cli_cmd_volume_create_parse (const char **words, int wordcount, dict_t **options
/* reset the count value now */
count = 1;
+ if (index >= wordcount) {
+ ret = -1;
+ goto out;
+ }
+
brick_index = index;
ret = cli_cmd_bricks_parse (words, wordcount, brick_index, &bricks,