From 479087c1e670faea4a0ef7a6d13a9869ef9de69f Mon Sep 17 00:00:00 2001 From: Raghavendra Talur Date: Thu, 29 Aug 2013 17:17:14 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/5733 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- api/src/glfs-fops.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'api') diff --git a/api/src/glfs-fops.c b/api/src/glfs-fops.c index 8ee9a207..3191ed70 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) { -- cgit