diff options
author | Anand Avati <avati@redhat.com> | 2013-02-05 17:03:38 -0800 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-02-05 19:58:02 -0800 |
commit | 765fdd0809afb1bdac49fae2a0a58ae092e5cde3 (patch) | |
tree | ca545051b6a09f347aef5a690a4505e804b6400b /xlators/mount | |
parent | e8d09b9ab9a93367a7135fc6b0e721c9d13e0e2d (diff) |
fuse(efence): zero sized memory was being allocated.
For the last call of getdents(), gf_malloc called with 0 size, which is then
caught by efence.
BUG: 782760
Change-Id: If289029117a62ecfcecc70480e5ac8f0e050487d
Signed-off-by: Anand Avati <avati@redhat.com>
Original-author: Varun Shastry <vshastry@redhat.com>
Reviewed-on: http://review.gluster.org/3846
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators/mount')
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 25545b78..ede936ac 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -2457,6 +2457,11 @@ fuse_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strlen (entry->d_name)); } + if (size <= 0) { + send_fuse_data (this, finh, 0, 0); + goto out; + } + buf = GF_CALLOC (1, size, gf_fuse_mt_char); if (!buf) { gf_log ("glusterfs-fuse", GF_LOG_DEBUG, |