From ca9e4bf6bcc947dd7c179c93dae206c6cde4d3b5 Mon Sep 17 00:00:00 2001 From: Nandaja Varma Date: Wed, 4 Feb 2015 17:19:40 +0530 Subject: gluster-cli : Extra checks for word_count removed. Coverity IDs: 1124453 1124454 In the first case, In the beginning of the function check is made to see of the word_count is less than 4. If yes it returns. So it wouldn't reach this part if that check takes the true path. So this code is logically dead. In second and third case, this is in false branch for word_cound <6. So word_count can't possibly be less than 5 at this point. Change-Id: Id5e1c81045ce7bc0ee6b7612ea54ef2b7f54b699 BUG: 789278 Signed-off-by: Nandaja Varma Reviewed-on: http://review.gluster.org/9582 Tested-by: Gluster Build System Reviewed-by: Humble Devassy Chirammal Reviewed-by: Vijay Bellur --- cli/src/cli-cmd-parser.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 140b021e363..84450a8f352 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -1082,10 +1082,6 @@ cli_cmd_quota_parse (const char **words, int wordcount, dict_t **options) } if (strcmp (w, "list") == 0) { - if (wordcount < 4) { - ret = -1; - goto out; - } type = GF_QUOTA_OPTION_TYPE_LIST; @@ -1493,10 +1489,6 @@ cli_cmd_volume_add_brick_parse (const char **words, int wordcount, index = 3; } else if ((strcmp (w, "replica")) == 0) { type = GF_CLUSTER_TYPE_REPLICATE; - if (wordcount < 5) { - ret = -1; - goto out; - } count = strtol (words[4], NULL, 0); if (!count || (count < 2)) { cli_err ("replica count should be greater than 1"); @@ -1509,10 +1501,6 @@ cli_cmd_volume_add_brick_parse (const char **words, int wordcount, index = 5; } else if ((strcmp (w, "stripe")) == 0) { type = GF_CLUSTER_TYPE_STRIPE; - if (wordcount < 5) { - ret = -1; - goto out; - } count = strtol (words[4], NULL, 0); if (!count || (count < 2)) { cli_err ("stripe count should be greater than 1"); -- cgit