summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-op-sm.c
diff options
context:
space:
mode:
authorShwetha Acharya <sacharya@redhat.com>2018-10-01 12:39:48 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-10-12 03:14:17 +0000
commit522dcab94ae9938c072cf50062b507cedafdc011 (patch)
tree8165ec73784ed002348a09f87e79fa8d331abfb6 /xlators/mgmt/glusterd/src/glusterd-op-sm.c
parent62faf7d37bd8b6be6657b1e3b61f92eac5b84653 (diff)
mgmt/glusterd: NULL pointer dereferencing clang fix
Problem: dereferencing of this->name; volinfo and xl can be null. Solution: Replaced this->name with apropriate names in few places, added a null check to avoid dereferencing of volinfo, and introduced a goto out statement, such that null pointer value is not passed to the function volgen_xlator_link when xl becomes NULL. Updates: bz#1622665 Change-Id: I77616bd23f58328cb6dbe681914a028991d49abb Signed-off-by: Shwetha Acharya <sacharya@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index ca09d5afe20..c8343fb0a2d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -1216,7 +1216,7 @@ glusterd_op_stage_set_volume(dict_t *dict, char **op_errstr)
*/
if ((dict_getn(dict, "is-special-key", SLEN("is-special-key")) ==
NULL) &&
- (volinfo->status != GLUSTERD_STATUS_NONE)) {
+ volinfo && (volinfo->status != GLUSTERD_STATUS_NONE)) {
snprintf(errstr, sizeof(errstr),
" 'gluster "
"volume set <VOLNAME> %s {enable, "