summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorRaghavendra Talur <rtalur@redhat.com>2013-08-29 17:17:14 +0530
committerAnand Avati <avati@redhat.com>2013-08-29 14:11:50 -0700
commit479087c1e670faea4a0ef7a6d13a9869ef9de69f (patch)
tree5babd1433c89bd4d9dddd9d0682e34293b5221de /api
parent2ec4b22bb02f572f74157df5264b247095fece77 (diff)
api: Add null check for active_subvol in glfs_close.
Problem: In glfs_close, NULL value returned by glfs_active_subvol was not being checked and was causing a crash. Change-Id: I6eefa60e7b07dee251b98932b1d08a5c2981d3d7 BUG: 1002511 Signed-off-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/5733 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'api')
-rw-r--r--api/src/glfs-fops.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c
index 8ee9a20772d..3191ed7009c 100644
--- a/api/src/glfs-fops.c
+++ b/api/src/glfs-fops.c
@@ -158,6 +158,11 @@ glfs_close (struct glfs_fd *glfd)
__glfs_entry_fd (glfd);
subvol = glfs_active_subvol (glfd->fs);
+ if (!subvol) {
+ ret = -1;
+ errno = EIO;
+ goto out;
+ }
fd = glfs_resolve_fd (glfd->fs, subvol, glfd);
if (!fd) {