summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2012-01-16 15:03:48 +0530
committerVijay Bellur <vbellur@redhat.com>2013-01-07 21:58:56 -0800
commit9af34ababcc2682bb668d00b7a49bac8e5fe7811 (patch)
tree059de345bbdb6305e66f6e90b92b0f269ccc6227
parent6c8918047009dee7286fb357a8b26fa551da101d (diff)
mgmt/glusterd: check brickinfo for NULL before dereferencing it
Change-Id: I59fed6adf13d6d72d79c986bf3578ca79b9756ac BUG: 781953 Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Reviewed-on: http://review.gluster.org/2648 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index c7edefc..c314aec 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -738,7 +738,8 @@ glusterd_volume_brickinfo_get (uuid_t uuid, char *hostname, char *path,
"given path %s lies"
" within %s", path,
brickiter->path);
- *brickinfo = brickiter;
+ if (brickinfo)
+ *brickinfo = brickiter;
break;
}
} else
@@ -748,7 +749,8 @@ glusterd_volume_brickinfo_get (uuid_t uuid, char *hostname, char *path,
" %s", brickiter->path,
path);
ret = 0;
- *brickinfo = brickiter;
+ if (brickinfo)
+ *brickinfo = brickiter;
break;
}
}