diff options
author | Amar Tumballi <amarts@redhat.com> | 2012-04-13 17:29:41 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-04-23 14:52:57 -0700 |
commit | 29f2de478cc6a475e6ae760d9cbe7ac847e9d79c (patch) | |
tree | 621fbb33e6e3de20f7c1b59a98e181c7b50b4796 /libglusterfs/src/options.c | |
parent | 4c9e8fad23836d87b0c4327e990c789630fe5b97 (diff) |
core: coverity issues fixed
this is not a complete set of issues getting fixed. Will
address other issues in another patch.
Change-Id: Ib01c7b11b205078cc4d0b3f11610751e32d14b69
Signed-off-by: Amar Tumballi <amarts@redhat.com>
BUG: 789278
Reviewed-on: http://review.gluster.com/3145
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'libglusterfs/src/options.c')
-rw-r--r-- | libglusterfs/src/options.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libglusterfs/src/options.c b/libglusterfs/src/options.c index 762f15f99b1..0aa942e209c 100644 --- a/libglusterfs/src/options.c +++ b/libglusterfs/src/options.c @@ -252,7 +252,8 @@ xlator_option_validate_str (xlator_t *xl, const char *key, const char *value, #endif } - if ((i <= ZR_OPTION_MAX_ARRAY_SIZE) && (!opt->value[i])) { + if (((i < ZR_OPTION_MAX_ARRAY_SIZE) && (!opt->value[i])) || + (i == ZR_OPTION_MAX_ARRAY_SIZE)) { /* enter here only if * 1. reached end of opt->value array and haven't * validated input @@ -720,7 +721,7 @@ xlator_volume_option_get_list (volume_opt_list_t *vol_list, const char *key) } else opt = vol_list->given_opt; - for (index = 0; opt[index].key && opt[index].key[0]; index++) { + for (index = 0; opt[index].key[0]; index++) { for (i = 0; i < ZR_VOLUME_MAX_NUM_KEY; i++) { cmp_key = opt[index].key[i]; if (!cmp_key) |