summaryrefslogtreecommitdiffstats
path: root/cli/src
diff options
context:
space:
mode:
authorNandaja Varma <nvarma@redhat.com>2015-02-04 17:19:40 +0530
committerVijay Bellur <vbellur@redhat.com>2015-04-10 06:40:26 +0000
commitca9e4bf6bcc947dd7c179c93dae206c6cde4d3b5 (patch)
tree561f26619a5680e47576d935b7f95745c2704e79 /cli/src
parent2b9a4799ef6caaeeca438c019f4a1f6cf423324a (diff)
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 <nvarma@redhat.com> Reviewed-on: http://review.gluster.org/9582 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'cli/src')
-rw-r--r--cli/src/cli-cmd-parser.c12
1 files changed, 0 insertions, 12 deletions
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");